Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About soona

  • Rank
  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
  • Create New...