Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by soona

  1. soona

    File Upload Control

    hi,How to save uploaded images in xml file using asp.net with C# codebehind?Thanks
  2. soona


    Hi,I am using asp.net with c#.i want to see the url link open in new window.when the checkbox will check. otherwise the link url open in same window without check the checkbox.how can i write code for this? i can see only link opened in new window for this code "chkNewWindow.Checked =true" on Page_Load event.In storeprocdure i have created field for 'chkwindows' with 'bit' datatype.Thanks
  3. Hi,i am using asp.net with c# codebehind.The Repeater control have checkbox, textbox.when i will enter some text in textbox control.it should display only the checked the entered text when i click submit button.how can i write code for this?Please send some sample code.
  4. soona

    Submit Button

    Hi,i am using asp.net with c#.i want to show decode my textbox value.for example i have two textbox controls,submit button and a label.i get the url name in text1.text, title in text2.text and a lable for display ouput.when i click submit button my output should display like this"www.sample.com?customerid=091&fullcode=erb90br7e6br7"please my ouput each word means fullcode -> (customerid(190) + title(text2.text[value]) .how can i decode this ?please advise me with codethanks
  5. Hi,i have one gridview . i want to display a Amount column on gridview with datas from database.Please check where i made a mistake in my below code.Because of i cannot see datas on grid view.But, it showing this error messages "Unable to cast object of type 'System.Data.DataRowView' to type 'Main.Details.Item'.i don't know this error message was link with in GridView. <asp:GridView ID="Grid1" runat="server"><Columns> <asp:TemplateField HeaderText="Amount"> <ItemTemplate> <asp:Label ID="Amount" runat="server" Text='<%# Eval('Amount')%>'></asp:Label> </ItemTemplate> </asp:TemplateField></Columns></asp:GridView>con.Open();SqlDataAdapter adapter = new SqlDataAdapter("select Amount from Detail,con);DataSet ds = new DataSet("Detail");myAdapter.Fill(ds, "Detail");Grid1.DataSource = ds;Grid1.DataBind();con.Close();Please can anyone tell how can i clear this error message and how can i display my Amount on gridview?Many thanks
  6. soona

    Server Controls

    Hi,i want to redirect some different page from gridview.When i click a particular row of column button on gridview .It will be redirect different page not a same page.For example: In gridview have 2 rows and 3columns.For each 2 rows have a buttons with data column.when i will click the 1st rowth of button in gridview. this button event should redirect some page(1stpage.aspx). and when i will click 2nd rowth of button in gridview.this button event will redirect some page. but do not redirect a same page(2ndpage.aspx).This can make to possible?----This code for listed out the datas on gridview <asp:GridView ID="Gridview1" runat="server" OnRowDataBound="Gridview1_RowDataBound"> <Columns> <asp:TemplateField> <ItemTemplate> <asp:Label ID="id" runat="server" Text='<%#Eval("ID")%>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField> <ItemTemplate> <asp:Label ID="name" runat="server" Text='<%#Classname1.getname(Container.DataItem)%>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField> <ItemTemplate> <uc:item ID="item" runat="server" itemname='<%#(item)Container.DataItem%>' /> </ItemTemplate> </asp:TemplateField> <asp:TemplateField> <ItemTemplate> <asp:Button ID="dbtn1" runat="server" Text="Click" /> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> Page_Load(){ itemColn items = Items(); if (items.Count > 0) { Gridview1.DataSource = items; Gridview1.DataBind(); } else { Gridview1.Visible = false; }} ----Please advise me . where can i make my related changes.Many thanks
  7. soona


    Hi,I am using asp.net 2.0 with c#.I have one Gridview with 3 rows and 4 columns. In the 1st row no need 5th column. if more than one row.I want to add a button in 2nd row of 5th column but not for 1st row.Is this possible in a gridview?If it is possible pls give some source or reference.Thanks
  8. Hi,In Repeater1 control after more than one row. next row will display button and Itemtemplate name.For example:In repeator control listed outpinkblueWhiteFrom this example i would like to change this likepinkblue button1(event)white button2(event)----------This is my existing code. i need to modify the above example.category.aspx<asp:PlaceHolder ID="panel1" runat="server"><ul><asp:Repeater ID="Repeater1" runat="server"><ItemTemplate><li ><asp:Literal ID="Label1" runat="server" Text='<%#Eval("Name")%>' /></li></ItemTemplate></asp:Repeater></ul></asp:PlaceHolder>category.aspx.csCategories Cat = GetItems(_Item1);panel1.Visible = (Cat.Count > 0);if (panel1.Visible){Repeater1.DataSource = Cat;Repeater1.DataBind();}How can i do ?Thanks
  9. soona

    Gridview Controls

    Hi,I am using asp.net2.0 with c# language.My doubts in GridView control.when i select three items at same time from categories(Fruits, Apples, Gifts). The selected items are displayed in gridview.Here i would like to change this "when i click more than one category at same time. it should be display selected item and button."For example: if i have to select Fruits, Apples from categories. it should be display like 1st "row have Fruits and In 2nd row have Apples and button" in gridview.the button have some event.How can i do it? Please can anyone answer me.With kind requestThanks
  10. soona

    Browser Issue

    hi,i am using asp.net with c# code behind.i created my own module with image effects using javascript.Explanation:i just get the value of width and height from end user for uploaded images.It works fine.but one issue will occurred.how to solve this issue?when i refresh the page. the uploaded images are display repeated without effects . that means it displayed the saved images. then It takes the effects. So, Please give some suggestion for my related questions.How to solve the issue : when i refresh the browser the images are display with repeatedly ! actually , my concept is need to display the images sequence order with effects.please replay soon to solve this one...Advance thanks
  11. soona

    Image Preload

    How to use image preload in asp.net .actually, i get the images from db to list out in repeatercontrol and the button click event shows the images.my worries :1. the uploaded images is not set the effects. it just shows the repeatedly(onebyone).when i fresh the browser. it shows the issue(one by one images).my ideas:So, i guess to use the "image preload " concept in asp.net. i just copy the JavaScript code from Google for imagepreload concepts.----------------------------------<script type="text/javascript">var myimages=new Array()function preloadimages(){for (i=0;i<preloadimages.arguments.length;i++){myimages=new Image()myimages.src=preloadimages.arguments}}preloadimages('ImageFolders/478_img_11.gif','ImageFolders/478_img_9.jpeg','ImageFolders/478_img_11.gif');</script></head><body onload="java script:preloadimages()"> ----- ---</body></html>----------------------------------In this code form : for (i=0;i<preloadimages.arguments.length;i++) ->here i need to set the my webcontrol("Repeatercontrol id"). how to fix ?please tell how to fix this?Please replay advance thanks....
  12. soona

    Imagesize Function

    hi,Subject: ImageResize in else statement.i am using asp.net with c#.when i upload a image it will check the valid image width and height size.if it is valid saved. if it is invalid got to resize.for example:This is my code to check the valid image width and height size.=======protected void cmdUpdate_Click(System.Object sender, System.EventArgs e) {using (System.Drawing.Bitmap objmap = new System.Drawing.Bitmap(FileUpload1.PostedFile.InputStream, false)) { int one, two; string path2 = ""; one = Convert.ToInt32(fixedWide); two = Convert.ToInt32(fixedHgt); if (objmap.Width == one && objmap.Height == two) { path1 = FileUpload1.PostedFile.FileName.ToString(); path2 = path1.Substring(path1.LastIndexOf("\\") + 1); string getimagepath = Server.MapPath(@"~\ImageFolders\"); getimagepath = getimagepath + Convert.ToString(ModuleId) + "_img_" + path2; FileUpload1.SaveAs(getimagepath); lblMsg.Text = "filesaved"; } else { lblMsg.Text = "Please give valid image size..."; } }}=====This code is run good.my question is: how to call the resize function in else statement.i don't know how to do image resize function. so, please give some idea and related reference source.andi just cut and paste this code in my else part statement: but i don't know this is correct or not?Please verify where can i made mistake?This is my full code for imageupload:================================================protected void cmdUpdate_Click(System.Object sender, System.EventArgs e) { using (System.Drawing.Bitmap objmap = new System.Drawing.Bitmap(FileUpload1.PostedFile.InputStream, false)) { int one, two; string path2 = ""; one = Convert.ToInt32(fixedWide); two = Convert.ToInt32(fixedHgt); if (objmap.Width == one && objmap.Height == two) { path1 = FileUpload1.PostedFile.FileName.ToString(); path2 = path1.Substring(path1.LastIndexOf("\\") + 1); string getimagepath = Server.MapPath(@"~\ImageFolders\"); getimagepath = getimagepath + Convert.ToString(ModuleId) + "_img_" + path2; FileUpload1.SaveAs(getimagepath); lblMsg.Text = "filesaved"; } else { path1 = FileUpload1.PostedFile.FileName.ToString(); path2 = path1.Substring(path1.LastIndexOf("\\") + 1); string getimgfolpath = Server.MapPath(@"~\DesktopModules\Demo\ImageFolders\"); getimgfolpath = getimgfolpath + Convert.ToString(ModuleId) + "_img_" + path2; FileUpload1.SaveAs(getimgfolpath); ImageResizeoption(getimgfolpath,path2); } }} public void ImageResizeoption(string parmFileIn, string Userid) { string filePathSourceFile = HttpContext.Current.Server.MapPath(@"~\ImageFolders\" + ModuleId.ToString() + "/"); string fullSourceFile = parmFileIn; int thumbnailHeight,thumbnailWidth; System.Drawing.Image sourceImage = System.Drawing.Image.FromFile(parmFileIn); thumbnailHeight = 181; thumbnailWidth = 358; System.Drawing.Image thumbnailImage = sourceImage.GetThumbnailImage(thumbnailWidth, thumbnailHeight, null, IntPtr.Zero); MemoryStream imageStream = new MemoryStream(); thumbnailImage.Save(imageStream, System.Drawing.Imaging.ImageFormat.Jpeg); string outfile = filePathSourceFile + "s" + ModuleId + "_" + Userid; try { thumbnailImage.Save(outfile); } catch (Exception e) { string dummy = e.ToString(); return; } }==========================================In the complete code doesnot shown any error message.Please see where i made mistake in my code(else part statement).Many Thanks
  13. hi,i am using asp.net with c# versionGenerally, the upload file control will get the whatever images(some different images and sizes) and saved.My doubt:I just create my code:when i upload the image with condition (fixed width and height sizes)its uploaded and saved.but it doesn't get same images(imagename).for example: i uploaded this image "car.gif(200 X 200)" it saved in my created path at once.again i uploaded the same image "car.gif(200 x 200)" it doesn't saved in my created path.actually i doesn't get it the same imagename.why?Please explain and reason for this.....I want to uploaded same imagename with fixed width and height.if it is possible please give some reference page or some sample source also...Please reply as soon as possible..Many thanks
  14. How to replace the Lowercase into uppercase for each word of starting character ?for example: "w3schools are superb experts" need to replace "W3schools Are Superb Experts"It is possible to do in javascript ? if it is do . please give some reference or source.Thanks
  15. soona

    day and month

    Hi, "i want to display exact months and days displayed in two textboxes".This is my following, my code is not work . please check where i made mistake , if any easy way .please let me know. thanks in advance---------------function getDiff(){var date1 = document.getElementById( "gmdpEmpprojStartDate" ).value;var date2 = document.getElementById( "gmdpEmpProjEndDate" ).value;if (date1.indexOf("-") != -1) { date1 = date1.split("-"); } else if (date1.indexOf("/") != -1) { date1 = date1.split("/"); } else { return 0; }if (date2.indexOf("-") != -1) { date2 = date2.split("-"); } else if (date2.indexOf("/") != -1) { date2 = date2.split("/"); } else { return 0; }if (parseInt(date1[0], 10) >= 1000) {var sDate = new Date(date1[0]+"/"+date1[1]+"/"+date1[2]);} else if (parseInt(date1[2], 10) >= 1000) {var sDate = new Date(date1[2]+"/"+date1[0]+"/"+date1[1]);} else {return 0;}if (parseInt(date2[0], 10) >= 1000) {var eDate = new Date(date2[0]+"/"+date2[1]+"/"+date2[2]);} else if (parseInt(date2[2], 10) >= 1000) {var eDate = new Date(date2[2]+"/"+date2[0]+"/"+date2[1]);} else {return 0;}var one_day = 1000*60*60*24;var daysApart = Math.abs(Math.ceil((sDate.getTime()-eDate.getTime())/one_day));var one_month=(1000*60*60*24*31);var a=Math.abs(Math.ceil((sDate.getTime()-eDate.getTime())/one_month));document.getElementById( "txtEmpAvailabilityPeriod" ).value = a;var days=daysApart-2*30;document.getElementById( "TextBox1" ).value = days; ---------------With kind regards
  16. soona


    Hi, now i am worked Asp.net.c#....designed one button ....button click event make conform MsgBox...use as following code..." Button1.Attributes.Add("onclick","return confirm('Are you sure you want to delete this record?');"); "it's work fine...but incase textbox value enter after press the enterkey automatically open the confirm MsgBox...why?here, i need to hide the Confirm msgbox at that time press enter key...pls it's urgent...help me....
  17. Hi, Is there a way to solve this? I will be opening a webpage say, www.xyz.com. In this site I will be having list of menus again which one of them will point to www.xyz.com. On click of each menu, I need to check whether that site is opened already. If yes, I will reload it else open it newly. It works fine for all urls except the self one mentioned above. Can anyone help me to resolve this.
  18. Hi,i want to pick a file from the particular folder how to do that in asp.net with c#.For example: when i click upload it want to open c:\folder by defualt how to do it in asp.net?Thanks
  19. Hi experts,Version: vs2005, asp.net with c#, sqlserver.How can i send automatically mail to all our employees in one company. for indicating birthday of particular employee.the mail to be sent through only my website.with out clicking any button. and it should be run automatically. how can i done this pls any one send sample code for me very urgent requirement.thanks
  20. Hi jes,Thanks for your kind advice.The "return false" statement :- >i need to display some message ("Please choice images size of '250 X 188',because your uploaded images is not placed").How to do this?Version: vs 2005(asp.net with c#)With kind regardsNancy.
  21. Hi,This is my code :public static bool IsValidImageDimention(HttpPostedFile postedFile, int specifiedWidth, int specifiedHeight) { Bitmap NewBitMap = new Bitmap(postedFile.InputStream, false); { if (NewBitMap.Height == specifiedHeight && NewBitMap.Width == specifiedWidth) { return true; } else { return false; } } }Please see else{ "return false;"} statement.Here, i would like to use confirm box for delete. the given explanation is: i uploaded the images when it is even otherwise goes to else statement with confirm box.My query: how to use confirm box "script" in asp.net code.Please give any idea about that and syntax also. please replay soon.With kind regardsNancy
  22. soona

    Datagrid in vs2003

    Hi,Now i work vs2003 asp.net c# datagrid...fotter i include delete button... header include chekbox1 ,itemtemplate include checkbox2... select header template checkbox all itemtemplate checkbox are selected.....it's work fine...1.now i need directly click the delete button give the error messagebox or alert message "select any one or more checkbox is must ".....2.after select the checkbox.checked=true the alert message "are you sure delete this record"...how to do it....my delete code as follows:private void DataGrid1_ItemCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e){CheckBox cm=new CheckBox();string str="";if(e.CommandName=="cmddel"){foreach(DataGridItem objItem in DataGrid1.Items){if(((CheckBox)objItem.Cells[6].FindControl("CheckBox1")).Checked == true){str+=((Label)objItem.Cells[0].FindControl("lbl_id")).Text+",";}}conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=E:/test/New Proposal Management 2003.mdb");conn.Open();com=new OleDbCommand("delete from Clients where ID in("+ str+ ")",conn);com.ExecuteNonQuery();conn.Close();//DataGrid1.EditItemIndex=-1;Label1.Text="Deleted ..!";}this.display();str="";} Thanks
  23. Hi experts,Pls clear my idea for my given code using asp.net with c#.protected void SubmitBtn_Click(object sender, EventArgs e) { path2 = ""; if ((ImageUpload.HasFile) && (ImageUpload.PostedFile.ContentLength != 0)) { path1 = ImageUpload.PostedFile.FileName.ToString(); path2 = path1.Substring(path1.LastIndexOf("\\") + 1); } string getimgfolpath = MapPath(@"~\Imagesfolder_1\"); getimgfolpath = getimgfolpath + Convert.ToString(Id) + "_img." + path2; ImageUpload.SaveAs(getimgfolpath); Bitmap upimgsize = new Bitmap(getimgfolpath); Imagesizes = String.Format("{0} and {1}", upimgsize.Width, upimgsize.Height); lblmsg.Text = Imagesizes ; }From the code explanation : Just saved a uploaded images in "Imagesfolder_1" folder and shown image width and height values in "lblmsg"I would like to check my uploaded image with fixed value.My Query:-> I dont know where to fix my own value(image sizes) and how to check with "Imagesizes" and "getimgfolpath" ?here, i confused how can i implement this concept.Please give some idea to implement and any suggestions for my query.Its very urgent.....Thanks
  24. hi Experts,In javascript :-> how to change text box value automatically ? when will give text box value from another input box?I gave code below.pls check . where i made mistake.----------------------------------------The javascript code as follows:<script language="javascript" type="text/javascript">function Fn_Add(){var first ="0"var second="0"var third="0"if(document.getElementById ("TextBox1").value!=""){first =document.getElementById ("TextBox1").value}else{document.getElementById("TextBox1").value="0"}if(document.getElementById ("TextBox2").value!=""){second=document.getElementById ("TextBox2").value}else{document.getElementById("TextBox2").value="0"}if(document.getElementById ("TextBox3").value!=""){third=document.getElementById ("TextBox3").value}else{document.getElementById("TextBox3").value="0"}document.getElementById ("TextBox4").value=parseInt(first)+parseInt(second) + parseInt(third)}</script>------------------------------------------now i given Three(3) Textbox value add And Result display in TextBox4...suppouse you given TextBox1 & TextBox3 value(ex:100,200) but didn't given TextBox2 values in run time...TextBox2 value built in 0 automaticaly...At that time of running in webpage you make it to change Each & Every single digit value in any Textbox automaticaly change the Result value...With kind regardsNancy
  • Create New...