Web Formshttp://forums.asp.net/18.aspx/1?Web+FormsServer controls, events, validation, master pages, themes, web parts, personalization, etc.Sat, 18 May 2013 05:18:25 -0400urn:uuid:00000000-0000-0000-0000-000000000018urn:uuid:00000000-0000-0000-0000-000005398783http://forums.asp.net/p/1907980/5398783.aspx/1?Difference+between+Thread+ThreadPool+BackgroundWorker+c+Difference between Thread, ThreadPool & BackgroundWorker c# <p>i many time call method with the help of thread like<br> &nbsp;<br> static void Main( string[] args )<br> {<br> Thread t = new Thread( MyFunction );<br> t.Start();<br> }<br> &nbsp;<br> static void MyFunction()<br> {<br> //code goes here<br> }<br> &nbsp;<br> and some time i use ThreadPool class also like<br> &nbsp;<br> System.Threading.ThreadPool.QueueUserWorkItem(delegate {<br> MyFunction();<br> }, null);<br> &nbsp;<br> but i do not understand what is the difference between calling any method with the help of thread class or ThreadPool class<br> &nbsp;<br> so i am looking a good discussion about what is the difference between Thread &amp; ThreadPool class.also need to know when we should use Thread class to call a method and when ThreadPool class to call any method ? if possible discuss also with sample code with sample situation.<br> &nbsp;<br> another very important question is that if i start multiple thread then my application performance will become low or bad ? if yes then tell me why...?<br> &nbsp;<br> now also tell me what is BackgroundWorker class and how it is different from Thread &amp; ThreadPool class. how far i heard that BackgroundWorker class also create a separate thread to run any method. so please discuss how it is different from Thread &amp; ThreadPool class and when one should go for BackgroundWorker class.<br> &nbsp;<br> here is small sample code of BackgroundWorker<br> &nbsp;<br> private void button1_Click(object sender, EventArgs e)<br> {<br> BackgroundWorker bw = new BackgroundWorker();<br> &nbsp;<br> // this allows our worker to report progress during work<br> bw.WorkerReportsProgress = true;<br> &nbsp;<br> // what to do in the background thread<br> bw.DoWork &#43;= new DoWorkEventHandler(<br> delegate(object o, DoWorkEventArgs args)<br> {<br> BackgroundWorker b = o as BackgroundWorker;<br> &nbsp;<br> // do some simple processing for 10 seconds<br> for (int i = 1; i &lt;= 10; i&#43;&#43;)<br> {<br> // report the progress in percent<br> b.ReportProgress(i * 10);<br> Thread.Sleep(1000);<br> }<br> &nbsp;<br> });<br> &nbsp;<br> // what to do when progress changed (update the progress bar for example)<br> bw.ProgressChanged &#43;= new ProgressChangedEventHandler(<br> delegate(object o, ProgressChangedEventArgs args)<br> {<br> label1.Text = string.Format(&quot;{0}% Completed&quot;, args.ProgressPercentage);<br> });<br> &nbsp;<br> // what to do when worker completes its task (notify the user)<br> bw.RunWorkerCompleted &#43;= new RunWorkerCompletedEventHandler(<br> delegate(object o, RunWorkerCompletedEventArgs args)<br> {<br> label1.Text = &quot;Finished!&quot;;<br> });<br> &nbsp;<br> bw.RunWorkerAsync();<br> }</p> 2013-05-18T19:07:51-04:002013-05-18T19:07:51.42-04:00urn:uuid:00000000-0000-0000-0000-000005398780http://forums.asp.net/p/1907978/5398780.aspx/1?error+if+typeof+Sys+undefined+throw+new+errorerror - if (typeof(Sys)) == 'undefined'throw new error <p>Hello all,</p> <p>My latest project is in .net frame work 4.0 and its working fine in my development pc. (I am using ajax controls)</p> <p>I deployed the working code in production server and it cant load 'the home page even and throwing out the following error.</p> <p>if (typeof(Sys)) == 'undefined'throw new error ASP.NET Ajax client-side framework failed to load.</p> <p>pls help me to solve this</p> <p></p> <p>thanks</p> <p>nick</p> 2013-05-18T18:51:29-04:002013-05-18T18:51:29.653-04:00urn:uuid:00000000-0000-0000-0000-000005397510http://forums.asp.net/p/1906887/5397510.aspx/1?invoke+a+popup+page+and+still+have+original+page+invoke a popup page and still have original page <p>after the page is submitted and edits/validations are performed in the postback, if there are errors I want to render up a static page with a list of all the errors, something like a js alert, and have the web form still available to make changes in the state it was when submitted. having the pop up page as a the guide where to correct the errors. when I try this it all executes but there is no page that comes up?</p> <p>have tried a few variations of the page info but never get the popup page</p> <pre class="prettyprint">Dim csname1 As String = &quot;PopupScript&quot; Dim url As String = &quot;donateack.aspx&quot; Dim cstype As Type = Me.GetType() 'Dim js As String = &quot;&lt;script&gt;window.open('{0}');&quot; Dim js As String = &quot;&lt;script&gt;window.open('myPage.aspx','nameOfWindow','tool bar=0,scrollbars=1,location=0,statusbar=1,menubar= 0,resizable=1,width=500,height=550)&quot; js = js &amp; &quot;&lt;/&quot; &amp; &quot;script&gt;&quot; ClientScript.RegisterStartupScript(cstype, &quot;newWindow&quot;, js, False)</pre> <p><br> <br> </p> 2013-05-18T06:32:39-04:002013-05-18T06:32:39.177-04:00urn:uuid:00000000-0000-0000-0000-000005398769http://forums.asp.net/p/1907973/5398769.aspx/1?sending+email+in+c+adding+drag+and+drop+file+attachments+functionality+like+yahoo+mailsending email in c# adding drag and drop file attachments functionality like yahoo mail <p>I want to add drag and drop feature as seen in yahoo mail for attaching files in my contact us page purely in asp.net not in mvc.The attched files should have thumbnail preview and optionally deleting button and progress bar.</p> 2013-05-18T17:35:04-04:002013-05-18T17:35:04.027-04:00urn:uuid:00000000-0000-0000-0000-000005397277http://forums.asp.net/p/1906826/5397277.aspx/1?Me+Title+cannot+be+setMe.Title cannot be set <p>Trying to set the title on 1 page in an application with dozens of pages using the following code:</p> <p>&nbsp;</p> <pre class="prettyprint">1 Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 2 If (Not IsPostBack) Then 3 Me.Title = &quot;This is the page title&quot; 4 End If 5 End Sub</pre> <p>The title is never set, and when I step through the code after line 3 executes Me.Title is equal to an emtpy string!</p> <p>I have this same code in dozens of pages through the app and it works fine.</p> 2013-05-17T17:28:36-04:002013-05-17T17:28:36.767-04:00urn:uuid:00000000-0000-0000-0000-000005397068http://forums.asp.net/p/1906768/5397068.aspx/1?Unable+to+access+control+from+div+dynamicallyUnable to access control from div dynamically <p>Hi,</p> <p>I addedd div server control at the desing time.</p> <pre class="prettyprint">&lt;div id=&quot;divReqDetails&quot; runat=&quot;server&quot;&gt; &lt;/div&gt;</pre> <p></p> <p>And added controls (like dropdownlist) to the div dynamically.</p> <pre class="prettyprint">DropDownList ddlCtrl = new DropDownList(); ddlCtrl.ID = "ddlChampion"; divReqDetails.Controls.Add(ddlCtrl);</pre> <p>I could not access&nbsp;dropdownlist from the code behind.</p> <pre class="prettyprint">DropDownList ddlChampion1 = (DropDownList)divReqDetails.FindControl("ddlChampion");</pre> <p>Can you please help me? please please ....</p> <p>&nbsp;</p> 2013-05-17T13:41:02-04:002013-05-17T13:41:02.823-04:00urn:uuid:00000000-0000-0000-0000-000005397092http://forums.asp.net/p/1906774/5397092.aspx/1?Populate+dropdown2+based+on+dropdown1Populate dropdown2 based on dropdown1 <p>Hi,</p> <p>I am new to asp and trying to populate a dropdownlist2 which is based on the value selected from dropdownlist1.</p> <p>The problem I am facing is that the primary key for the table linked to dropdownlist1 is an integrity column (which is also the foreign key for table linked to dropdownlist2).&nbsp; Based on this I have tried to create a code (attached). The issue I am facing within the code is related to this part:</p> <p>if <span face="Consolas" size="2" style="font-size:small; font-family:Consolas"> (dt.Rows.Count &gt; 0)</span></p> <p>{</p> <p>ddlsubfunc.DataSource = dt;</p> <p>ddlsubfunc.DataTextField = <span face="Consolas" size="2" color="#a31515" style="font-size:small; color:#a31515; font-family:Consolas"> <span face="Consolas" size="2" color="#a31515" style="font-size:small; color:#a31515; font-family:Consolas"><span face="Consolas" size="2" color="#a31515" style="font-size:small; color:#a31515; font-family:Consolas">&quot;SUB_FUNCTION_NAME&quot;</span></span></span><span face="Consolas" size="2" style="font-size:small; font-family:Consolas">;<span face="Consolas" size="2" style="font-size:small; font-family:Consolas"></span></span></p> <p>ddlsubfunc.DataValueField = <span face="Consolas" size="2" color="#a31515" style="font-size:small; color:#a31515; font-family:Consolas"> <span face="Consolas" size="2" color="#a31515" style="font-size:small; color:#a31515; font-family:Consolas"><span face="Consolas" size="2" color="#a31515" style="font-size:small; color:#a31515; font-family:Consolas">&quot;SUB_FUNCTION_NAME&quot;</span></span></span><span face="Consolas" size="2" style="font-size:small; font-family:Consolas">;</span></p> <p>ddlsubfunc.DataBind();</p> <p>}</p> <p>&nbsp;Could anybody please know what to change in the above code ?</p> <pre class="prettyprint">private void BuilsubfuncList() { DataTable dt = new DataTable(); var func_ID = &quot;&quot;; Label lblsubfuncid = DvsubfuncDetails.FindControl(&quot;lblsubfuncid&quot;) as Label; if (lblsubfuncid != null) { func_ID = lblsubfuncid.Text; } using (SqlConnection connection = new SqlConnection(GetConnectionString())) { string sql = &quot;select Distinct SUB_FUNCTION_NAME from SUB_FUNCTION sf inner join [function] f on sf.function_ID = f.Function_ID where sf.function_ID=@func_ID&quot;; using (SqlCommand cmd = new SqlCommand(sql, connection)) { cmd.Parameters.AddWithValue(&quot;@func_ID&quot;, func_ID); SqlDataAdapter ad = new SqlDataAdapter(cmd); ad.Fill(dt); } } if (dt.Rows.Count &gt; 0) { ddlsubfunc.DataSource = dt; ddlsubfunc.DataTextField = &quot;SUB_FUNCTION_NAME&quot;; ddlsubfunc.DataValueField = &quot;SUB_FUNCTION_NAME&quot;; ddlsubfunc.DataBind(); } }</pre> <p></p> <p>&nbsp;</p> 2013-05-17T14:04:22-04:002013-05-17T14:04:22.987-04:00urn:uuid:00000000-0000-0000-0000-000005398646http://forums.asp.net/p/1907941/5398646.aspx/1?Is+there+any+way+to+convert+all+images+saved+in+session+To+PDF+and+download+that+PDFIs there any way to convert all images saved in session To PDF and download that PDF <p>Is there any way to convert all images saved in session To PDF and download that PDF</p> <p>When client login in website he randomly selects somes images from website which are saved in session ,Is dere any way to convert all images selected by client &nbsp;as PDF n den client click on button its download all images selected as PDF.</p> <p>Plz suggest</p> 2013-05-18T11:03:20-04:002013-05-18T11:03:20.29-04:00urn:uuid:00000000-0000-0000-0000-000005397239http://forums.asp.net/p/1906813/5397239.aspx/1?How+to+use+Unicode+in+ASP+NET+web+application+How to use Unicode in ASP.NET web application?? <p>Hi all,</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I am making ASP.NET web application which uses language other than english, that is Hindi(kruti Dev) For ex:-Hindi(Kruti Dev)=रोहित and its unicode conversion=%u0930%u094B%u0939%u093F%u0924 , i want to use this unicode in my entire application, so that it shows only रोहित(from example above)&nbsp;So please can anyone tell me what are settings required in ASP.NET application for unicode&nbsp;,Also please tell me should i store data as Unicode in database table or as my language[Hindi(Kruti Dev) ].??Please help me</p> <p>&nbsp;</p> <p>Thanks in advance</p> <p>Rohit J</p> 2013-05-17T16:33:50-04:002013-05-17T16:33:50.243-04:00urn:uuid:00000000-0000-0000-0000-000005398666http://forums.asp.net/p/1907947/5398666.aspx/1?Execute+a+stored+procedure+after+change+text+in+textboxExecute a stored procedure after change text in textbox <p>Hi</p> <p>Is it possible to change a text in text box calling the stored &nbsp;procedure (update textbox)?</p> 2013-05-18T12:08:04-04:002013-05-18T12:08:04.643-04:00urn:uuid:00000000-0000-0000-0000-000005397543http://forums.asp.net/p/1906895/5397543.aspx/1?Website+Content+in+local+languageWebsite Content in local language <p>hello</p> <p></p> <p>How can i develop a website in local language.</p> <p>I could write the content but when it displayed in browsers some characters are displayed wrong and space&nbsp;</p> <p>displayed as a square. How can i solve this issue. Shall I need to use any dll files .</p> <p>One general example you can see in&nbsp;</p> <p><a href="http://www.manoramaonline.com/">http://www.manoramaonline.com</a></p> <p>They use something like this&nbsp;</p> <p><a href="http://www.manoramaonline.com/cgi-bin/MMOnline.dll/portal/ep/home.do?tabId=0">http://www.manoramaonline.com/cgi-bin/MMOnline.dll/portal/ep/home.do?tabId=0</a></p> <p>What may be this MMOnline.dll ? any guess? Is it for language support</p> <p>For this website there is no issue in the content as I mentioned above</p> <p></p> <p>This site also deliver the content perfectly</p> <p><a href="http://www.mathrubhumi.com/">http://www.mathrubhumi.com</a></p> <p></p> <p>Please help</p> <p></p> <p></p> <p></p> 2013-05-18T07:37:44-04:002013-05-18T07:37:44.27-04:00urn:uuid:00000000-0000-0000-0000-000005398634http://forums.asp.net/p/1907927/5398634.aspx/1?Make+Title+of+the+Report+above+table+gridview+which+is+exported+to+PDFMake Title of the Report above table gridview which is exported to PDF <p><span lang="en"><span class="hps">Dear All,</span></span></p> <p><span lang="en"><span class="hps"><span id="result_box" class="short_text" lang="en"><span class="hps">I am</span> <span class="hps">a beginner</span><span>,</span> <span class="hps">in making the</span> <span class="hps">PDF</span> <span class="hps">Report</span><span>.</span></span></span></span></p> <p><span lang="en"><span class="hps"><span class="short_text" lang="en"><span><span id="result_box" lang="en"><span class="hps">How do I add</span> <span class="hps">a</span> <span class="hps">title</span> <span class="hps">report</span><span></span> <span class="hps">in</span> <span class="hps">PDF</span> <span class="hps">Report</span><span>,</span> <span class="hps">on</span> <span class="hps">a</span> <span class="hps">table</span><span></span> <span class="hps">as the</span> <span class="hps">report</span> <span class="hps"> title</span><span>.</span></span></span></span></span></span></p> <p><span id="result_box" lang="en"><span class="hps">I</span> <span class="hps">do</span> <span class="hps">Export</span> <span class="hps">Gridview</span> <span class="hps"> to</span> <span class="hps">PDF</span><span>,</span> <span class="hps">using a</span> <span class="hps">script</span> <span class="hps">like this:</span></span></p> <pre class="prettyprint">Protected Sub btnExport_Click(sender As Object, e As System.EventArgs) Dim columnsCount As Integer = gv1.HeaderRow.Cells.Count Dim pdfTable As New PdfPTable(columnsCount) For Each gridViewHeaderCell As TableCell In gv1.HeaderRow.Cells ' Create the Font Object for PDF document Dim font As New Font ' Set the font color to GridView header row font color ' font.Color = New iTextSharp.text.Color(gv1.HeaderStyle.ForeColor) ' Create the PDF cell, specifying the text and font Dim pdfCell As New PdfPCell(New Phrase(gridViewHeaderCell.Text, font)) ' Set the PDF cell backgroundcolor to GridView header row BackgroundColor color 'pdfCell.BackgroundColor = New BaseColor(GridView1.HeaderStyle.BackColor) ' Add the cell to PDF table pdfTable.AddCell(pdfCell) Next For Each gridViewRow As GridViewRow In gv1.Rows If gridViewRow.RowType = DataControlRowType.DataRow Then ' Loop thru each cell in GrdiView data row For Each gridViewCell As TableCell In gridViewRow.Cells Dim font As New Font() 'font.Color = New BaseColor(GridView1.RowStyle.ForeColor) Dim pdfCell As New PdfPCell(New Phrase(gridViewCell.Text, font)) ' pdfCell.BackgroundColor = New BaseColor(GridView1.RowStyle.BackColor) pdfTable.AddCell(pdfCell) Next End If Next ' Create the PDF document specifying page size and margins 'Dim pdfDocument As New Document(PageSize.A4, 10.0F, 10.0F, 10.0F, 10.0F) Dim pdfDocument As New Document(New Rectangle(288.0F, 144.0F), 10, 10, 50, 10) pdfDocument.SetPageSize(iTextSharp.text.PageSize.A4.Rotate()) PdfWriter.GetInstance(pdfDocument, Response.OutputStream) pdfDocument.Open() pdfDocument.Add(pdfTable) pdfDocument.Close Response.ContentType = &quot;application/pdf&quot; Response.AppendHeader(&quot;content-disposition&quot;, &quot;attachment;filename=Member.pdf&quot;) Response.Write(pdfDocument) Response.Flush() Response.[End]() End Sub</pre> <p><span lang="en"><span class="hps"><br> Thank you.<br> </span></span></p> 2013-05-18T10:37:41-04:002013-05-18T10:37:41.053-04:00urn:uuid:00000000-0000-0000-0000-000005081901http://forums.asp.net/p/1827652/5081901.aspx/1?How+do+I+show+a+message+after+successful+insert+and+also+after+insert+fails+How do I show a message after successful insert and also after insert fails? <p>I would like to display a message to the user after successful insert into the database. Could someone please help? I have seen many ways to do it but I am still stuck.</p> <p>Here is my insert code in aspx:</p> <p>&lt;asp:sqldatasource id=&quot;SqlDataSource2&quot; runat=&quot;server&quot; <br> connectionstring=&quot;&lt;%&#36; ConnectionStrings:aid1133ConnectionString3 %&gt;&quot; <br> <br> <br> insertcommand=&quot;INSERT INTO dbo.aspnet_UsersInRoles(UserId, RoleId) <br> VALUES (@UserId, @RoleId)&quot;<br> selectcommand=&quot;SELECT dbo.aspnet_Roles.RoleName, dbo.aspnet_Users.LastName, <br> dbo.aspnet_Users.FirstName FROM dbo.aspnet_Roles INNER JOIN dbo.aspnet_Applications <br> ON dbo.aspnet_Roles.ApplicationId = dbo.aspnet_Applications.ApplicationId <br> INNER JOIN dbo.aspnet_Users ON dbo.aspnet_Applications.ApplicationId = dbo.aspnet_Users.ApplicationId <br> AND dbo.aspnet_Applications.ApplicationId = dbo.aspnet_Users.ApplicationId <br> AND dbo.aspnet_Applications.ApplicationId = dbo.aspnet_Users.ApplicationId <br> AND dbo.aspnet_Applications.ApplicationId = dbo.aspnet_Users.ApplicationId <br> AND dbo.aspnet_Applications.ApplicationId = dbo.aspnet_Users.ApplicationId <br> AND dbo.aspnet_Applications.ApplicationId = dbo.aspnet_Users.ApplicationId&quot;&gt;<br> <br> &lt;insertparameters&gt;<br> &lt;asp:parameter name=&quot;UserId&quot; /&gt;<br> &lt;asp:parameter name=&quot;RoleId&quot; /&gt;<br> <br> &lt;/insertparameters&gt;</p> 2012-07-25T14:59:45-04:002012-07-25T14:59:45.823-04:00urn:uuid:00000000-0000-0000-0000-000005395851http://forums.asp.net/p/1906468/5395851.aspx/1?email+an+application+form+with+imageemail an application form with image <p>hi everyone,</p> <p></p> <p>i have an application form in which there is a fileupload for uploading image... it will show in image control.. i want to send the whole contents including image as email like an exam hall ticket...</p> <p></p> <p>here is my codes,</p> <p><span style="text-decoration:underline"><strong>aspx code</strong></span></p> <p>&lt;%@ Page Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot; CodeFile=&quot;Default.aspx.cs&quot; EnableEventValidation=&quot;false&quot; Inherits=&quot;_Default&quot; %&gt;</p> <p>&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;</p> <p>&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;<br> &lt;head runat=&quot;server&quot;&gt;<br> &lt;title&gt;onlineform&lt;/title&gt;<br> &lt;style type=&quot;text/css&quot;&gt;<br> .style1<br> {<br> width: 100%;<br> }<br> .style2<br> {<br> width: 219px;<br> }<br> .style3<br> {<br> width: 346px;<br> }<br> &lt;/style&gt;<br> &lt;/head&gt;<br> &lt;body&gt;<br> &lt;form id=&quot;form1&quot; runat=&quot;server&quot;&gt;<br> &lt;div&gt;<br> <br> &lt;table class=&quot;style1&quot;&gt;<br> &lt;tr&gt;<br> &lt;td class=&quot;style2&quot;&gt;<br> &amp;nbsp;&lt;/td&gt;<br> &lt;td class=&quot;style3&quot;&gt;<br> &amp;nbsp;&lt;/td&gt;<br> &lt;td&gt;<br> &lt;asp:Image ID=&quot;coverimg&quot; runat=&quot;server&quot; Width=&quot;142px&quot; /&gt;<br> &lt;/td&gt;<br> &lt;/tr&gt;<br> &lt;tr&gt;<br> &lt;td class=&quot;style2&quot;&gt;<br> Name&lt;/td&gt;<br> &lt;td class=&quot;style3&quot;&gt;<br> &lt;asp:TextBox ID=&quot;txtName&quot; runat=&quot;server&quot;&gt;&lt;/asp:TextBox&gt;<br> &lt;/td&gt;<br> &lt;td&gt;<br> &amp;nbsp;&lt;/td&gt;<br> &lt;/tr&gt;<br> &lt;tr&gt;<br> &lt;td class=&quot;style2&quot;&gt;<br> Age&lt;/td&gt;<br> &lt;td class=&quot;style3&quot;&gt;<br> &lt;asp:TextBox ID=&quot;txtAge&quot; runat=&quot;server&quot;&gt;&lt;/asp:TextBox&gt;<br> &lt;/td&gt;<br> &lt;td&gt;<br> &amp;nbsp;&lt;/td&gt;<br> &lt;/tr&gt;<br> &lt;tr&gt;<br> &lt;td class=&quot;style2&quot;&gt;<br> Address&lt;/td&gt;<br> &lt;td class=&quot;style3&quot;&gt;<br> &lt;asp:TextBox ID=&quot;txtAddress&quot; runat=&quot;server&quot; TextMode=&quot;MultiLine&quot;&gt;&lt;/asp:TextBox&gt;<br> &lt;/td&gt;<br> &lt;td&gt;<br> &amp;nbsp;&lt;/td&gt;<br> &lt;/tr&gt;<br> &lt;tr&gt;<br> &lt;td class=&quot;style2&quot;&gt;<br> Image&lt;/td&gt;<br> &lt;td class=&quot;style3&quot;&gt;<br> &lt;asp:FileUpload ID=&quot;fupload&quot; runat=&quot;server&quot; /&gt;<br> &lt;asp:Button ID=&quot;btnUpload&quot; runat=&quot;server&quot; onclick=&quot;btnUpload_Click&quot; <br> Text=&quot;Upload&quot; /&gt;<br> &lt;/td&gt;<br> &lt;td&gt;<br> &amp;nbsp;&lt;/td&gt;<br> &lt;/tr&gt;<br> &lt;tr&gt;<br> &lt;td class=&quot;style2&quot;&gt;<br> &amp;nbsp;&lt;/td&gt;<br> &lt;td class=&quot;style3&quot;&gt;<br> &lt;asp:Button ID=&quot;btnSubmit&quot; runat=&quot;server&quot; Text=&quot;Send&quot; /&gt;<br> &lt;/td&gt;<br> &lt;td&gt;<br> &amp;nbsp;&lt;/td&gt;<br> &lt;/tr&gt;<br> &lt;/table&gt;<br> <br> &lt;/div&gt;<br> &lt;/form&gt;<br> &lt;/body&gt;<br> &lt;/html&gt;</p> <p></p> <p><span style="text-decoration:underline"><strong>c# code</strong></span></p> <p><span style="text-decoration:underline"><strong></strong></span></p> <p>using System;<br> using System.Collections.Generic;<br> using System.Linq;<br> using System.Web;<br> using System.Web.UI;<br> using System.Web.UI.WebControls;</p> <p><span style="text-decoration:underline"><strong></strong></span></p> <p>public partial class _Default : System.Web.UI.Page<br> {<br> protected void Page_Load(object sender, EventArgs e)<br> {</p> <p><span style="text-decoration:underline"><strong></strong></span></p> <p>}<br> protected void btnUpload_Click(object sender, EventArgs e)<br> {<br> if (fupload.HasFile)<br> {</p> <p><span style="text-decoration:underline"><strong></strong></span></p> <p>string ext = System.IO.Path.GetExtension(fupload.FileName);<br> if (ext == &quot;.jpeg&quot; || ext == &quot;.jpg&quot; || ext == &quot;.jif&quot; || ext == &quot;.png&quot;)<br> {<br> string path = txtName.Text &#43; ext;<br> fupload.SaveAs(MapPath(path));<br> coverimg.ImageUrl = path;</p> <p><span style="text-decoration:underline"><strong></strong></span></p> <p>}<br> }<br> }<br> }</p> <p></p> <p>thanks in advance</p> <p><span style="text-decoration:underline"><strong><br> </strong></span></p> 2013-05-16T11:25:12-04:002013-05-16T11:25:12.79-04:00urn:uuid:00000000-0000-0000-0000-000005397116http://forums.asp.net/p/1906782/5397116.aspx/1?Any+way+to+completely+hide+LisBox+vertical+scroll+barAny way to completely hide LisBox vertical scroll bar <p>Hi,</p> <p>I've been following advice on hiding a ListBox vertical scroll bar.</p> <p>I have found same advice in lots places and URL below gives good example of it.</p> <p>http://stackoverflow.com/questions/468980/asp-net-how-to-hide-listbox-control-vertical-scrollbar</p> <p>My problem is that though the advice seems to work to stop the actual scroll bar appearing, it does not stop the grey bar at the right of the ListBox, which the scroll bar sits in, appearing. This is still there even though the scroll bar is not.</p> <p>Does anyone know how to get rid of this grey bar also?</p> <p>Thank you.</p> 2013-05-17T14:24:06-04:002013-05-17T14:24:06.29-04:00urn:uuid:00000000-0000-0000-0000-000005397546http://forums.asp.net/p/1906898/5397546.aspx/1?the+problem+is+with+time+the+error+of+not+selecting+6+hrs+from+now+time+does+not+work+the+user+cud+select+any+error+no+error+is+shownthe problem is with time the error of not selecting 6 hrs from now time does not work the user cud select any error no error is shown <p>&lt;script type=&quot;text/javascript&quot;&gt;<br> function checkDate(sender, args) {<br> if (sender._selectedDate &lt; new Date()) {<br> alert(&quot;You cannot select a day earlier than today!&quot;);<br> sender._selectedDate = new Date();<br> // set the date back to the current date<br> sender._textbox.set_Value(sender._selectedDate.format(sender._format))<br> }<br> }</p> <p></p> <p>&lt;asp:Panel runat=&quot;server&quot; ID=&quot;panel2&quot;&gt;<br> &lt;table&gt;<br> &lt;tr&gt;<br> &lt;td colspan=&quot;4&quot; bgcolor=&quot;#FFFFCC&quot; class=&quot;tx1&quot; align=&quot;center&quot; style=&quot;height: 20px&quot;&gt;» Special Request Form&lt;/td&gt; <br> &lt;/tr&gt;<br> <br> &lt;tr&gt;<br> &lt;td&gt;<br> &lt;asp:Label ID=&quot;Label2&quot; runat=&quot;server&quot; Text=&quot;Trip Scheme&quot;&gt;&lt;/asp:Label&gt;<br> &lt;/td&gt;<br> &lt;td&gt;<br> &lt;asp:DropDownList ID=&quot;DropDownList2&quot; runat=&quot;server&quot; AutoPostBack=&quot;True&quot; AppendDataBoundItems=&quot;true&quot;<br> DataSourceID=&quot;SqlDataSource1&quot; DataTextField=&quot;tripscheme&quot; <br> DataValueField=&quot;stdcharge&quot; onselectedindexchanged=&quot;DropDownList2_SelectedIndexChanged&quot; <br> &gt;&lt;asp:ListItem Selected=&quot;True&quot; Text=&quot;- Select Trip -&quot;&gt;&lt;/asp:ListItem&gt;<br> &lt;/asp:DropDownList&gt;<br> &lt;asp:SqlDataSource ID=&quot;SqlDataSource1&quot; runat=&quot;server&quot; <br> ConnectionString=&quot;&lt;%&#36; ConnectionStrings:ConnectionString1 %&gt;&quot; <br> SelectCommand=&quot;SELECT [tripscheme],[stdcharge] FROM [tripscheme]&quot;&gt;&lt;/asp:SqlDataSource&gt;<br> &lt;/td&gt;<br> <br> <br> &lt;td&gt;<br> &lt;asp:Label ID=&quot;Label4&quot; runat=&quot;server&quot; Text=&quot;Pick Up Date&quot;&gt;&lt;/asp:Label&gt;<br> &lt;/td&gt;<br> &lt;td&gt;&lt;asp:TextBox ID=&quot;datepicker&quot; runat=&quot;server&quot; &gt;&lt;/asp:TextBox&gt;<br> &lt;/td&gt;<br> <br> &lt;asp:CalendarExtender ID=&quot;CalendarExtender1&quot; runat=&quot;server&quot; TargetControlID=&quot;datepicker&quot; OnClientDateSelectionChanged=&quot;checkDate&quot;&gt;<br> &lt;/asp:CalendarExtender&gt;<br> &lt;/tr&gt;<br> &lt;tr&gt;<br> &lt;td&gt;<br> <br> &lt;asp:Label ID=&quot;Label9&quot; runat=&quot;server&quot; Text=&quot;PickUp time&quot;&gt;&lt;/asp:Label&gt;<br> &lt;/td&gt;<br> &lt;td&gt;<br> &lt;asp:DropDownList ID=&quot;DropDownList1&quot; runat=&quot;server&quot;&gt;<br> <br> &lt;asp:ListItem&gt;12:00:00 AM&lt;/asp:ListItem&gt;<br> &lt;asp:ListItem&gt;1:00:00 AM&lt;/asp:ListItem&gt;<br> &lt;asp:ListItem&gt;2:00:00 AM&lt;/asp:ListItem&gt;<br> &lt;asp:ListItem&gt;3:00:00 AM&lt;/asp:ListItem&gt;<br> &lt;asp:ListItem&gt;4:00:00 AM&lt;/asp:ListItem&gt;<br> &lt;asp:ListItem&gt;5:00:00 AM&lt;/asp:ListItem&gt;<br> &lt;asp:ListItem&gt;6:00:00 AM&lt;/asp:ListItem&gt;<br> &lt;asp:ListItem&gt;7:00:00 AM&lt;/asp:ListItem&gt;<br> &lt;asp:ListItem&gt;8:00:00 AM&lt;/asp:ListItem&gt;<br> &lt;asp:ListItem&gt;9:00:00 AM&lt;/asp:ListItem&gt;<br> &lt;asp:ListItem&gt;10:00:00 AM&lt;/asp:ListItem&gt;<br> &lt;asp:ListItem&gt;11:00:00 AM&lt;/asp:ListItem&gt;<br> &lt;asp:ListItem&gt;12:00:00 PM&lt;/asp:ListItem&gt;<br> &lt;asp:ListItem&gt;13:00:00 PM&lt;/asp:ListItem&gt;<br> &lt;asp:ListItem&gt;14:00:00 PM&lt;/asp:ListItem&gt;<br> &lt;asp:ListItem&gt;15:00:00 PM&lt;/asp:ListItem&gt;<br> &lt;asp:ListItem&gt;16:00:00 PM&lt;/asp:ListItem&gt;<br> &lt;asp:ListItem&gt;17:00:00 PM&lt;/asp:ListItem&gt;<br> &lt;asp:ListItem&gt;18:00:00 PM&lt;/asp:ListItem&gt;<br> &lt;asp:ListItem&gt;19:00:00 PM&lt;/asp:ListItem&gt;<br> &lt;asp:ListItem&gt;20:00:00 PM&lt;/asp:ListItem&gt;<br> &lt;asp:ListItem&gt;21:00:00 PM&lt;/asp:ListItem&gt;<br> &lt;asp:ListItem&gt;22:00:00 PM&lt;/asp:ListItem&gt;<br> &lt;asp:ListItem&gt;23:00:00 PM&lt;/asp:ListItem&gt;</p> <p><br> &lt;/asp:DropDownList&gt;<br> <br> <br> &lt;/td&gt;<br> <br> &lt;asp:CustomValidator ID=&quot;CustomValidator1&quot; runat=&quot;server&quot; ErrorMessage=&quot;Time selected should be 6 hrs greater from now time&quot; ControlToValidate=&quot;DropDownList1&quot; OnServerValidate=&quot;check&quot;&gt;&lt;/asp:CustomValidator&gt;<br> <br> &lt;td&gt;<br> &lt;asp:Label ID=&quot;Label3&quot; runat=&quot;server&quot; Text=&quot; Car Type:&quot;&gt;&lt;/asp:Label&gt;<br> &lt;/td&gt;<br> &lt;td&gt;<br> &lt;asp:DropDownList ID=&quot;DropDownList3&quot; runat=&quot;server&quot; AutoPostBack=&quot;true&quot;<br> <br> onselectedindexchanged=&quot;DropDownList3_SelectedIndexChanged&quot;&gt;<br> &lt;asp:ListItem&gt;select&lt;/asp:ListItem&gt;<br> &lt;asp:ListItem Value=&quot;A.C&quot;&gt;A.C&lt;/asp:ListItem&gt;<br> &lt;asp:ListItem Value=&quot;Non A.C&quot;&gt;Non A.C&lt;/asp:ListItem&gt;<br> &lt;/asp:DropDownList&gt;<br> <br> &lt;/td&gt;<br> &lt;td&gt;<br> <br> &lt;asp:TextBoxWatermarkExtender ID=&quot;TextBoxWatermarkExtender1&quot; runat=&quot;server&quot; TargetControlID=&quot;txtfrom&quot; WatermarkText=&quot;enter from address&quot;&gt;<br> &lt;/asp:TextBoxWatermarkExtender&gt;<br> &lt;/td&gt;<br> <br> &lt;/tr&gt;<br> &lt;tr&gt;<br> &lt;td&gt;<br> &lt;asp:Label ID=&quot;Label5&quot; runat=&quot;server&quot; Text=&quot;Car Category:&quot;&gt;&lt;/asp:Label&gt;<br> &lt;/td&gt;<br> &lt;td&gt;<br> &lt;asp:DropDownList ID=&quot;DropDownList4&quot; runat=&quot;server&quot; AutoPostBack=&quot;true&quot;<br> onselectedindexchanged=&quot;DropDownList4_SelectedIndexChanged&quot; &gt;<br> <br> &lt;/asp:DropDownList&gt; <br> <br> &lt;/td&gt;<br> <br> <br> &lt;td&gt;<br> &lt;asp:Label ID=&quot;Label7&quot; runat=&quot;server&quot; Text=&quot;From:&quot;&gt;&lt;/asp:Label&gt;<br> &lt;/td&gt;<br> &lt;td&gt;<br> &lt;asp:TextBox ID=&quot;txtfrom&quot; runat=&quot;server&quot; TextMode=&quot;SingleLine&quot;&gt;&lt;/asp:TextBox&gt;<br> <br> &lt;/td&gt;<br> &lt;td&gt;<br> &lt;asp:FilteredTextBoxExtender ID=&quot;FilteredTextBoxExtender4&quot; runat=&quot;server&quot; TargetControlID=&quot;txtfrom&quot; FilterType=&quot;Numbers, UppercaseLetters, LowercaseLetters&quot;&gt;<br> &lt;/asp:FilteredTextBoxExtender&gt;<br> <br> &lt;asp:TextBoxWatermarkExtender ID=&quot;TextBoxWatermarkExtender3&quot; runat=&quot;server&quot; TargetControlID=&quot;txtfrom&quot; WatermarkText=&quot;enter from address&quot;&gt;<br> &lt;/asp:TextBoxWatermarkExtender&gt;<br> &lt;/td&gt;<br> <br> &lt;/tr&gt;<br> &lt;tr&gt;<br> &lt;td&gt;<br> &lt;asp:Label ID=&quot;Label8&quot; runat=&quot;server&quot; Text=&quot;To:&quot;&gt;&lt;/asp:Label&gt;<br> &lt;/td&gt;<br> &lt;td&gt;&lt;asp:TextBox ID=&quot;txtto&quot; runat=&quot;server&quot; TextMode=&quot;SingleLine&quot; &gt;&lt;/asp:TextBox&gt;<br> <br> <br> &lt;/td&gt;<br> <br> &lt;asp:TextBoxWatermarkExtender ID=&quot;TextBoxWatermarkExtender4&quot; runat=&quot;server&quot; TargetControlID=&quot;txtto&quot; WatermarkText=&quot;enter dest. address&quot;&gt;<br> &lt;/asp:TextBoxWatermarkExtender&gt;<br> <br> <br> <br> &lt;td&gt;<br> &lt;asp:Label ID=&quot;Label10&quot; runat=&quot;server&quot; Text=&quot;Notes&quot;&gt;&lt;/asp:Label&gt;<br> &lt;/td&gt;<br> &lt;td&gt;&lt;asp:TextBox ID=&quot;txtnots&quot; runat=&quot;server&quot; TextMode=&quot;SingleLine&quot;&gt;&lt;/asp:TextBox&gt;<br> <br> <br> &lt;/td&gt;</p> <p>&lt;td&gt;<br> &lt;asp:TextBoxWatermarkExtender ID=&quot;TextBoxWatermarkExtender5&quot; runat=&quot;server&quot; TargetControlID=&quot;txtnots&quot; WatermarkText=&quot;enter if any additional info&quot;&gt;<br> &lt;/asp:TextBoxWatermarkExtender&gt; <br> &lt;/td&gt;</p> <p><br> &lt;td&gt;<br> <br> &lt;asp:Label ID=&quot;lblstatus&quot; runat=&quot;server&quot;&gt;&lt;/asp:Label&gt;<br> &lt;/td&gt;<br> &lt;asp:TextBox ID=&quot;TextBox1&quot; runat=&quot;server&quot; Visible=&quot;false&quot; Text=&quot;pending&quot;&gt;&lt;/asp:TextBox&gt;<br> <br> &lt;/tr&gt;<br> &lt;tr&gt;<br> &lt;td&gt; <br> &lt;asp:Label ID=&quot;Label1&quot; runat=&quot;server&quot; Text=&quot;Rate&quot;&gt;&lt;/asp:Label&gt;&lt;/td&gt;<br> &lt;td&gt;<br> &lt;asp:TextBox ID=&quot;txtrate&quot; runat=&quot;server&quot;&gt;&lt;/asp:TextBox&gt; <br> &lt;asp:TextBox ID=&quot;txtrate1&quot; runat=&quot;server&quot; Visible=&quot;false&quot;&gt;&lt;/asp:TextBox&gt; <br> <br> <br> &lt;/td&gt;<br> <br> &lt;/tr&gt;<br> <br> <br> &lt;/table&gt;<br> &lt;/asp:Panel&gt;</p> <p></p> <p>&lt;/fieldset&gt;<br> &lt;table&gt;<br> &lt;tr&gt;&lt;td&gt;<br> &lt;asp:Button ID=&quot;Button1&quot; runat=&quot;server&quot; Text=&quot;Submit Form&quot; <br> onclick=&quot;Button1_Click&quot; /&gt;<br> &lt;asp:Button ID=&quot;Button2&quot; runat=&quot;server&quot; Text=&quot;Reset&quot; OnClientClick=&quot;this.form.reset();return false;&quot;/&gt;<br> &lt;asp:ConfirmButtonExtender ID=&quot;ConfirmButtonExtender1&quot; runat=&quot;server&quot; TargetControlID=&quot;Button1&quot; ConfirmText=&quot;are you sure to submit details??&quot; OnClientCancel=&quot;CancelClick&quot;&gt;<br> &lt;/asp:ConfirmButtonExtender&gt;&lt;/td&gt;<br> &lt;/tr&gt;</p> <p></p> <p></p> <p></p> <p>c# code:</p> <p>protected void Button1_Click(object sender, EventArgs e)<br> {<br> string sql = @&quot;Data Source=SAJITH-PC\SQLEXPRESS;Initial Catalog=myfile1;Integrated Security=True&quot;;<br> string name = txtname.Text;<br> string dept = txtdept.Text;<br> string cost = txtcostcode.Text;<br> <br> string mob = txtmob.Text;<br> string hodname = txthodname.Text;<br> string hodmail = txthmail.Text;<br> string date = datepicker.Text;<br> string from = txtfrom.Text;<br> string to = txtto.Text;<br> string not = txtnots.Text;<br> string status = TextBox1.Text;<br> string rate = txtrate.Text;</p> <p>if (Convert.ToInt32(txtp.Text) % 2 == 0)<br> {</p> <p>SqlConnection con = new SqlConnection(sql);<br> SqlCommand com = new SqlCommand();<br> com.CommandType = CommandType.Text;<br> com.Connection = con;<br> com.CommandText = &quot;Insert into [main] (username,dept,costcode,mobileno,hodusername,hodemail,pickupdate,pickuptime,fromdest,todest,notes,cartype,carcategory,tripscheme,status,rate)&quot; &#43; &quot;values (@username,@dept,@costcode,@mobileno,@hodusername,@hodemail,@pickupdate,@pickuptime,@fromdest,@todest,@notes,@cartype,@carcategory,@tripscheme,@status,@rate)&quot;;<br> com.Parameters.Clear();</p> <p>com.Parameters.AddWithValue(&quot;@username&quot;, name);<br> com.Parameters.AddWithValue(&quot;@dept&quot;, dept);<br> com.Parameters.AddWithValue(&quot;@costcode&quot;, cost);<br> com.Parameters.AddWithValue(&quot;@mobileno&quot;, mob);</p> <p>com.Parameters.AddWithValue(&quot;@hodusername&quot;, hodname);<br> com.Parameters.AddWithValue(&quot;@hodemail&quot;, hodmail);<br> com.Parameters.AddWithValue(&quot;@pickupdate&quot;, date);<br> com.Parameters.AddWithValue(&quot;@pickuptime&quot;, DropDownList1.SelectedValue);</p> <p>com.Parameters.AddWithValue(&quot;@fromdest&quot;, from);<br> com.Parameters.AddWithValue(&quot;@todest&quot;, to);<br> com.Parameters.AddWithValue(&quot;@notes&quot;, not);<br> com.Parameters.AddWithValue(&quot;@cartype&quot;, DropDownList3.SelectedValue);<br> com.Parameters.AddWithValue(&quot;@carcategory&quot;,DropDownList4.SelectedValue);<br> com.Parameters.AddWithValue(&quot;@tripscheme&quot;,DropDownList2.SelectedValue);<br> com.Parameters.AddWithValue(&quot;@status&quot;,status);<br> com.Parameters.AddWithValue(&quot;@rate&quot;,rate);</p> <p><br> try<br> {<br> con.Open();<br> com.ExecuteNonQuery();<br> }<br> catch (SQLException ex)<br> { // Log your error<br> lblstatus.Text = &quot;An error occured&quot; &#43; ex.Message;<br> throw ex;<br> }<br> finally<br> {<br> if (con != null)<br> {<br> con.Close();<br> }<br> }<br> }</p> <p>else {</p> <p>SqlConnection con = new SqlConnection(sql);<br> SqlCommand com = new SqlCommand();<br> com.CommandType = CommandType.Text;<br> com.Connection = con;<br> com.CommandText = &quot;Insert into [approve] (username,mobileno,dept,costcode,date,time,fromdest,todest,notes,cartype,carcategory,tripscheme,status)&quot; &#43; &quot;values (@username,@mobileno,@dept,@costcode,@date,@time,@fromdest,@todest,@notes,@cartype,@carcategory,@tripscheme,@status)&quot;;<br> com.Parameters.Clear();</p> <p>com.Parameters.AddWithValue(&quot;@username&quot;, name);<br> com.Parameters.AddWithValue(&quot;@dept&quot;, dept);<br> com.Parameters.AddWithValue(&quot;@costcode&quot;, cost);<br> com.Parameters.AddWithValue(&quot;@mobileno&quot;, mob);</p> <p><br> com.Parameters.AddWithValue(&quot;@date&quot;, date);<br> com.Parameters.AddWithValue(&quot;@time&quot;, DropDownList1.SelectedValue);</p> <p>com.Parameters.AddWithValue(&quot;@fromdest&quot;, from);<br> com.Parameters.AddWithValue(&quot;@todest&quot;, to);<br> com.Parameters.AddWithValue(&quot;@notes&quot;,not);<br> com.Parameters.AddWithValue(&quot;@cartype&quot;, DropDownList3.SelectedValue);<br> com.Parameters.AddWithValue(&quot;@carcategory&quot;, DropDownList4.SelectedValue);<br> com.Parameters.AddWithValue(&quot;@tripscheme&quot;, DropDownList2.SelectedValue);<br> com.Parameters.AddWithValue(&quot;@status&quot;,status);<br> con.Open();<br> com.ExecuteNonQuery();<br> con.Close();<br> <br> <br> }</p> <p>Response.Redirect(&quot;~/USER/appreq.aspx&quot;); <br> }</p> <p>protected void check(object sender, ServerValidateEventArgs args)<br> {</p> <p><br> DateTime t1 = Convert.ToDateTime(DropDownList1.SelectedValue);<br> DateTime t2 = Convert.ToDateTime(DateTime.Now.AddHours(6));<br> int result = DateTime.Compare(t1, t2);<br> if (result &lt; 0)<br> {<br> args.IsValid = false;<br> }<br> else<br> {<br> args.IsValid = true;<br> }<br> }</p> <p>protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e)<br> {</p> <p>if (DropDownList3.SelectedValue== &quot;A.C&quot;)<br> {<br> bindlist();</p> <p>}</p> <p>if (DropDownList3.SelectedValue== &quot;Non A.C&quot;)<br> {<br> bindanotherlist();<br> }</p> <p><br> }<br> <br> private void bindlist()<br> {</p> <p>string sql = @&quot;Data Source=SAJITH-PC\SQLEXPRESS;Initial Catalog=myfile1;Integrated Security=True&quot;;<br> SqlConnection con = new SqlConnection(sql);<br> SqlCommand cmd = new SqlCommand(&quot;select vehicle,charge from vehicle&quot; ,con);<br> SqlDataAdapter sa = new SqlDataAdapter(cmd);<br> DataSet ds = new DataSet();<br> sa.Fill(ds);<br> DropDownList4.DataSource = ds.Tables[0].DefaultView;<br> DropDownList4.DataTextField = &quot;vehicle&quot;;<br> DropDownList4.DataValueField = &quot;charge&quot;;<br> <br> <br> DropDownList4.DataBind();<br> DropDownList4.Items.Insert(0, new ListItem(&quot;--Select--&quot;));</p> <p></p> <p>}</p> <p>private void bindanotherlist()<br> {<br> string sql = @&quot;Data Source=SAJITH-PC\SQLEXPRESS;Initial Catalog=myfile1;Integrated Security=True&quot;;<br> SqlConnection con = new SqlConnection(sql);<br> SqlCommand cmd = new SqlCommand(&quot;select vehicle,charge from nonac&quot;, con);<br> SqlDataAdapter sa = new SqlDataAdapter(cmd);<br> DataSet ds = new DataSet();<br> sa.Fill(ds);<br> DropDownList4.DataSource = ds.Tables[0].DefaultView;<br> DropDownList4.DataBind();<br> DropDownList4.DataTextField = &quot;vehicle&quot;;</p> <p>DropDownList4.DataValueField = &quot;charge&quot;;</p> <p>DropDownList4.Items.Insert(0, new ListItem(&quot;--Select--&quot;));</p> <p><br> <br> }</p> <p>protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)<br> {<br> txtrate1.Text = DropDownList2.SelectedValue;<br> }</p> <p>protected void DropDownList4_SelectedIndexChanged(object sender, EventArgs e)<br> {<br> int total = Convert.ToInt32(txtrate1.Text) &#43; Convert.ToInt32(DropDownList4.SelectedValue);<br> txtrate.Text = total.ToString();<br> }</p> 2013-05-18T07:40:12-04:002013-05-18T07:40:12.613-04:00urn:uuid:00000000-0000-0000-0000-000005398583http://forums.asp.net/p/1907908/5398583.aspx/1?Erroe+Object+reference+not+set+to+an+instance+of+an+object+Erroe:Object reference not set to an instance of an object. <pre class="prettyprint">&lt;asp:UpdatePanel ID=&quot;UpdatePanel1&quot; UpdateMode=&quot;Conditional&quot; runat=&quot;server&quot; &gt; &lt;ContentTemplate&gt; &lt;asp:RadioButtonList ID=&quot;RadioButtonList1&quot; runat=&quot;server&quot; align=&quot;left&quot; RepeatDirection=&quot;Horizontal&quot; AutoPostBack=&quot;True&quot; onselectedindexchanged=&quot;RadioButtonList1_SelectedIndexChanged&quot;&gt; &lt;asp:ListItem Selected=&quot;True&quot; Value=&quot;0&quot;&gt;ABCD&lt;/asp:ListItem&gt; &lt;asp:ListItem Value=&quot;1&quot;&gt;123&lt;/asp:ListItem&gt; &lt;/asp:RadioButtonList&gt; &lt;/ContentTemplate&gt; &lt;/asp:UpdatePanel&gt; &lt;asp:UpdatePanel ID=&quot;UpdatePanel2&quot; runat=&quot;server&quot; UpdateMode=&quot;Conditional&quot;&gt; &lt;ContentTemplate&gt; &lt;asp:Table ID=&quot;Table1&quot; runat=&quot;server&quot;&gt; &lt;asp:TableRow&gt; &lt;asp:TableCell&gt; &lt;table id=&quot;tblclient&quot; runat=&quot;server&quot; &gt; &lt;tr&gt; &lt;td&gt; &lt;asp:Label ID=&quot;lblclient&quot; runat=&quot;server&quot; Text=&quot;from ABCD&quot;&gt;&lt;/asp:Label&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/asp:TableCell&gt; &lt;/asp:TableRow&gt; &lt;asp:TableRow&gt; &lt;asp:TableCell&gt; &lt;table id=&quot;tblEmployee&quot; runat=&quot;server&quot; &gt; &lt;tr&gt; &lt;td&gt; &lt;asp:Label ID=&quot;lblEmp&quot; runat=&quot;server&quot; Text=&quot;from 123&quot;&gt;&lt;/asp:Label&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/asp:TableCell&gt; &lt;/asp:TableRow&gt; &lt;/asp:Table&gt; &lt;/ContentTemplate&gt; &lt;Triggers&gt; &lt;asp:AsyncPostBackTrigger ControlID=&quot;RadioButtonList1&quot; EventName=&quot;SelectedIndexChanged&quot; /&gt; &lt;/Triggers&gt; &lt;/asp:UpdatePanel&gt; C# protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e) { System.Web.UI.HtmlControls.HtmlTable tblABCD = (System.Web.UI.HtmlControls.HtmlTable)FindControl(&quot;tblABCD&quot;); System.Web.UI.HtmlControls.HtmlTable tbl123 = (System.Web.UI.HtmlControls.HtmlTable)FindControl(&quot;tbl123&quot;); int index = Convert.ToInt32(RadioButtonList1.SelectedIndex); if (value == 0) { tblABCD.Visible = true; tbl123.Visible = false; UpdatePanel1.Update(); UpdatePanel2.Update(); } else { <strong> tblABCD.Visible = false;</strong> tbl123.Visible = true; UpdatePanel1.Update(); UpdatePanel2.Update(); } } }</pre> <p>Hear am getting an runtime exception in line <span style="text-decoration:underline"> <strong>tblABCD.visible=false;</strong></span> telling Object reference not set to an instance of an object.</p> <p>please help me out for solving this problem</p> 2013-05-18T09:10:37-04:002013-05-18T09:10:37.503-04:00urn:uuid:00000000-0000-0000-0000-000005398564http://forums.asp.net/p/1907902/5398564.aspx/1?incorrect+syntax+at+error+shown+at+da+Fill+dt+hod+incorrect syntax at "=" error shown at da.Fill(dt,"hod"); <p>protected void Page_Load(object sender, EventArgs e)<br> {<br> if (Session[&quot;username&quot;] != null)<br> {<br> Label6.Text = Session[&quot;hodusername&quot;].ToString();<br> } <br> <br> GetData();<br> moredata();</p> <p>}</p> <p></p> <p>public void GetData()<br> {</p> <p><br> string connstring = @&quot;Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\myfile.mdf;Integrated Security=True;User Instance=True&quot;;<br> SqlConnection con = new SqlConnection(connstring);</p> <p>SqlDataAdapter sa = new SqlDataAdapter(&quot;select hodusername,hodemail,dept,design,mobile from hod WHERE hodusername=' &quot; &#43; Label6.Text.ToString() &#43; &quot; ' &quot;, con);</p> <p>SqlDataAdapter da = new SqlDataAdapter(connstring, con);<br> DataSet dt = new DataSet();<br> da.Fill(dt,&quot;hod&quot;);</p> <p>if (dt.Tables[0].Rows.Count &gt; 0)<br> {</p> <p>txtname.Text = dt.Tables[0].Rows[0][&quot;hodusername&quot;].ToString();<br> txtemail.Text = dt.Tables[0].Rows[0][&quot;hodemail&quot;].ToString();<br> txtdept.Text = dt.Tables[0].Rows[0][&quot;dept&quot;].ToString();<br> txtgrade.Text = dt.Tables[0].Rows[0][&quot;design&quot;].ToString();</p> <p><br> txtmob.Text = dt.Tables[0].Rows[0][&quot;mobile&quot;].ToString();<br> }</p> <p></p> <p></p> <p></p> <p>}<br> public void moredata()<br> {</p> <p><br> string connstring = @&quot;Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\myfile.mdf;Integrated Security=True;User Instance=True&quot;;<br> SqlConnection con = new SqlConnection(connstring);</p> <p>SqlDataAdapter sa = new SqlDataAdapter(&quot;select * from desgn where design='&quot; &#43; Session[&quot;design&quot;] &#43; &quot;'&quot;, con);</p> <p>SqlDataAdapter da = new SqlDataAdapter(connstring, con);<br> DataSet dt = new DataSet();<br> da.Fill(dt, &quot;desgn&quot;);</p> <p>if (dt.Tables[0].Rows.Count &gt; 0)<br> {</p> <p><br> txtextno.Text = dt.Tables[0].Rows[0][&quot;designcode&quot;].ToString();</p> <p>txtcostcode.Text = dt.Tables[0].Rows[0][&quot;costcode&quot;].ToString();</p> <p></p> <p></p> 2013-05-18T08:23:41-04:002013-05-18T08:23:41.707-04:00urn:uuid:00000000-0000-0000-0000-000005397156http://forums.asp.net/p/1906787/5397156.aspx/1?Grid+View+Paging+Filter+Error+pagingGrid View Paging Filter - Error paging <p>I have a gridview with textboxes above it for users to input text and search/filter the results returned to the gridview. If I search for something invalid like &lt;Script&gt;&lt;/script&gt;, then I receive an error when paging on&nbsp;the grid view. I did not know the paging hyperlinks (i.e. 1, 2, 3, etc) caused the page to validate.</p> <p>Is there anyway to&nbsp;stop the&nbsp;grid view paging action from submitting the form&nbsp;information, aka the filter data?</p> 2013-05-17T15:05:34-04:002013-05-17T15:05:34.487-04:00urn:uuid:00000000-0000-0000-0000-000005397552http://forums.asp.net/p/1906899/5397552.aspx/1?only+upload+mp3+file+in+asp+net+using+validation+Expressiononly upload mp3 file in asp.net using validation Expression <p>Hi,</p> <p>I am using RegularExpressionValidator&nbsp;to check the audio file format before save. Here is the code for&nbsp;RegularExpressionValidator=</p> <p><br> /^(([a-zA-Z]:)|(\\{2}\w&#43;)\&#36;?)(\\(\w[\w].*))&#43;(.mp3|.MP3|.mpeg|.MPEG|.m3u|.M3U )&#36;/</p> <p>But it is not working. Please suggest me where is the error.</p> <p>Here is my Audio file Path=D:\SongCollection\Hindi\DIL\DAM DAMA DAM.MP3</p> <p>when I click on save button, it will give the error( means regular expression error)</p> <p></p> <p></p> <p></p> 2013-05-18T07:43:56-04:002013-05-18T07:43:56.77-04:00