ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2017 www.aspforums.com. All rights reserved.Validate TextBox inside UserControl using JavaScript in ASP.Net<p>Hi,</p> <div class="post-text"> <p>I am using a usercontrol which has two textboxes named txtUserName,txtPassword and a button&nbsp; named btnSubmit.I am using this usercontrol in my webpage.I want to show alert message in the webpage if the user didnot enter the username or password .&nbsp;&nbsp; </p> <p>How can i achieve this?</p> <p>Thanks</p> </div> <p>&nbsp;</p>http://www.aspforums.net/Threads/552423/Validate-TextBox-inside-UserControl-using-JavaScript-in-ASPNet/http://www.aspforums.net/Threads/552423/Validate-TextBox-inside-UserControl-using-JavaScript-in-ASPNet/Wed, 10 Apr 2013 00:03:40 GMTValidate Session set after login and redirect user back to login page if it is NULL in ASP.Net<p>Hi</p> <p>I have made a web page in which there is login screen when user login it goes next page</p> <p>but my problem is if i directly enter the url of that page it open</p> <p>i want it should not open unless the user log in</p> <p>&nbsp;</p>http://www.aspforums.net/Threads/917862/Validate-Session-set-after-login-and-redirect-user-back-to-login-page-if-it-is-NULL-in-ASPNet/http://www.aspforums.net/Threads/917862/Validate-Session-set-after-login-and-redirect-user-back-to-login-page-if-it-is-NULL-in-ASPNet/Fri, 26 Apr 2013 00:24:05 GMTValidate Money Currency format in ASP.Net TextBox using Validators<p>dear fellas,&nbsp;</p> <p>im trying to dcreate a requiredfieldvalidator that only accept amount of money.&nbsp;</p> <p>first i used this expresvalidator as it cant receive any letter.</p> <p>&nbsp;</p> <pre class="brush: vb">&lt;asp:RegularExpressionValidator ID=&#34;rvcheckno&#34; runat=&#34;server&#34; ErrorMessage=&#34;Amount receive numbers only!&#34; ControlToValidate=&#34;tbamount&#34; InitialValue=&#34;0&#34; ValidationGroup=&#34;number&#34;&gt; &lt;/asp:RegularExpressionValidator&gt;</pre> <p>but then it also cant receive cent.</p> <p>i was trying to do something that can accept <span style="text-decoration: underline;"><strong>130.00</strong></span></p> <p>tq</p>http://www.aspforums.net/Threads/122608/Validate-Money-Currency-format-in-ASPNet-TextBox-using-Validators/http://www.aspforums.net/Threads/122608/Validate-Money-Currency-format-in-ASPNet-TextBox-using-Validators/Wed, 08 Jan 2014 08:50:21 GMTUser adccms already has more than max_user_connections active connections<h2><em>Hello sir,</em></h2> <p><em>i am geting this error when an product add or edit from the siteadmin.</em></p> <p><em>this error show on public sidealso.</em></p> <h2>&nbsp;</h2> <h2><em>User adccms already has more than 'max_user_connections' active connections</em></h2>http://www.aspforums.net/Threads/382488/User-adccms-already-has-more-than-maxuserconnections-active-connections/http://www.aspforums.net/Threads/382488/User-adccms-already-has-more-than-maxuserconnections-active-connections/Wed, 25 Feb 2015 03:21:23 GMTUploading audio file based on the user specified ID.<p>I want to upload audio file based on the ID which i choose</p> <p>For ex: I have three ID's in drop downlist, say</p> <p>ID #1: 1001</p> <p>ID #2: 1002</p> <p>ID #3: 1003</p> <p>I want to upload audio file for 1001. Later, On the same id i may upload another file also.&nbsp;</p> <p>Then, If i choose 1001, the list of files that has been uploaded on 1001 sholud be displayed with download option in Gridview.</p> <p>For SQL SERVER 2008.&nbsp;</p> <p>Kindly help me. Thanks in advance.</p>http://www.aspforums.net/Threads/178331/Uploading-audio-file-based-on-the-user-specified-ID/http://www.aspforums.net/Threads/178331/Uploading-audio-file-based-on-the-user-specified-ID/Mon, 25 Apr 2016 01:47:50 GMTUpload Image and display on User Profile page in ASP.Net<p>Hi all,</p> <p>I am making a Human resource Management system in which i have to make &nbsp;employee profiles, there is a page in which i am entering employee name and uploading a rofile picture and i want the next page to show that image on a left corner of every employee...after clicking on the submit button of the previous page please help !!!</p>http://www.aspforums.net/Threads/393752/Upload-Image-and-display-on-User-Profile-page-in-ASPNet/http://www.aspforums.net/Threads/393752/Upload-Image-and-display-on-User-Profile-page-in-ASPNet/Wed, 08 Jan 2014 03:21:41 GMTunable to get the user input in required format in console application n c#<p>Hello Everyone.</p> <p>Create a class Employee which will implement the below interface: IEmployee. The application should accept the function to invoke and its parameters from the console in the Format:</p> <p>[MethodName]:[Parameter1]:[Parameter2] Ex: SetProperty:Age:44</p> <p>The implemetation shold have the necessary checks on whether the input is in correct format by handling like FormatException.And the program should be able to continuously accept the input and print corresponding output until the input given as "Exit".</p> <p>&nbsp;</p> <p>&nbsp;</p> <pre class="brush: csharp">using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication1 { class Example { interface IEmployee { int ID { get; set; } int Age { get; set; } } class Employee : IEmployee { public int ID { get; set; } public int Age { get; set; } public void Set(string propertyName, Object value) { switch (propertyName.ToLower()) { case &#34;id&#34;: ID = Convert.ToInt32(value); break; case &#34;age&#34;: Age = Convert.ToInt32(value); break; default: break; } Console.WriteLine(&#34;Property {0} set successfully&#34;, propertyName); } public void Print(string propertyName) { dynamic value = null; switch (propertyName.ToLower()) { case &#34;id&#34;: value = ID; break; case &#34;age&#34;: value = Age; break; default: break; } if (value != null) { Console.WriteLine(&#34;{0} : {1}&#34;, propertyName, value); } else { Console.WriteLine(&#34;No Property Found&#34;); } } } static void Main(string[] args) { var emp = new Employee(); var str = String.Empty; do { try { Console.WriteLine(&#34;Input : &#34;); str = Console.ReadLine(); if (string.IsNullOrEmpty(str)) { throw new FormatException(&#34;No input provided&#34;); } var words = str.Split(&#39;:&#39;); switch (words[0].ToLower()) { case &#34;set&#34;: if (words.Count() != 3) { throw new FormatException(&#34;input is not in correct format&#34;); } emp.Set(words[1], words[2]); break; case &#34;print&#34;: if (words.Count() != 2) { throw new FormatException(&#34;Input is not in correct format&#34;); } emp.Print(words[1]); break; default: break; } } catch (Exception ex) { Console.WriteLine(ex.Message); } } while (!str.ToString().Equals(&#34;Exit&#34;)); Console.Read(); } } }</pre> <p>Issue: I am unable take the user input in the corresponding format.in the above code everytime I have to give the user input in the format "Set:Age:33" but this is not I m looking for .Actually firstly the expected input and output should be given in the format as per the screenshot I have attached.</p>http://www.aspforums.net/Threads/208975/unable-to-get-the-user-input-in-required-format-in-console-application-n-c/http://www.aspforums.net/Threads/208975/unable-to-get-the-user-input-in-required-format-in-console-application-n-c/Mon, 18 Apr 2016 01:45:27 GMTTrigger one UserControl event from another UserControl event<p>Hi</p> <p>I have page having two user controls. Now I have a requirement for which i have to trigger one user control event from another user control.</p> <p>If this is possible then please guide me in this regard</p> <p>Regards</p> <p>TanzeelurRehman</p>http://www.aspforums.net/Threads/785537/Trigger-one-UserControl-event-from-another-UserControl-event/http://www.aspforums.net/Threads/785537/Trigger-one-UserControl-event-from-another-UserControl-event/Thu, 14 Feb 2013 03:36:35 GMTSwitching users from HTTP to HTTPS after login<p>Hi</p> <p>I have a following requirment. In my website, any user login with his/her credentials at that time URL should be switched to HTTPS from HTTP till the user logged out. After Log Out, URL change to HTTP from HTTPS.</p> <p>I am storing username in Session and from that I can check whether user is logged in or not but how to change URL at that time.</p> <p>Kindly help.</p>http://www.aspforums.net/Threads/627506/Switching-users-from-HTTP-to-HTTPS-after-login/http://www.aspforums.net/Threads/627506/Switching-users-from-HTTP-to-HTTPS-after-login/Thu, 13 Sep 2012 08:10:44 GMTSimple User Comments Form using Database in ASP.Net<p>Hello everyone,</p> <p>i was owndering if you happen to have a simple Comments form syntax with CSS, so that &nbsp;a person can leave his/her name, e-mail, subject and comments. the form that can write under the question when Reply is pressed by the person.</p> <p>example:&nbsp;</p> <p>Question<br />&nbsp; &nbsp; &nbsp; &nbsp;Reply</p> <p><span style="font-size: 9pt;">thank you.&nbsp;</span></p> <p>&nbsp;</p>http://www.aspforums.net/Threads/190413/Simple-User-Comments-Form-using-Database-in-ASPNet/http://www.aspforums.net/Threads/190413/Simple-User-Comments-Form-using-Database-in-ASPNet/Mon, 18 Nov 2013 06:34:03 GMTShow Session Expire Timeout Countdown to users in ASP.Net<p>Hi friends,</p> <p>&nbsp;&nbsp;&nbsp; I need to show how to show countdownwhen the user session expire? if users session expire means i need to redirct user to login page..</p> <p>&nbsp;&nbsp; How can i achieve this?</p>http://www.aspforums.net/Threads/475580/Show-Session-Expire-Timeout-Countdown-to-users-in-ASPNet/http://www.aspforums.net/Threads/475580/Show-Session-Expire-Timeout-Countdown-to-users-in-ASPNet/Mon, 17 Dec 2012 01:38:14 GMTShow Hide specific section of page based on User Type or Role in ASP.Net<p>I have LOGIN PANEL for student, and I want to disable it in different page. And only the admin can enable and disable it. I dont know the logic behind here. Thanks~</p>http://www.aspforums.net/Threads/106380/Show-Hide-specific-section-of-page-based-on-User-Type-or-Role-in-ASPNet/http://www.aspforums.net/Threads/106380/Show-Hide-specific-section-of-page-based-on-User-Type-or-Role-in-ASPNet/Mon, 24 Nov 2014 01:31:09 GMTShow hide Label based on user status using C# in ASP.Net<p>if user account in database is true how do i show lable on page member</p> <p>&nbsp;</p> <pre class="brush: csharp"> public DataTable GetProfile(string username) { SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings[&#34;DB_A000E6_FIRSTAPP001&#34;].ConnectionString); SqlDataAdapter adp = new SqlDataAdapter(&#34;GetUserPOSTS&#34;, conn); adp.SelectCommand.CommandType = CommandType.StoredProcedure; // adp.SelectCommand.Parameters.AddWithValue(&#34;@Email&#34;, username); adp.SelectCommand.Parameters.AddWithValue(&#34;@UserName&#34;, username); adp.SelectCommand.Parameters.AddWithValue(&#34;@Id&#34;, Id); DataTable dt = new DataTable(); // adp.Fill(dt); return dt;</pre> <p>sql</p> <p>&nbsp;</p> <pre class="brush: sql">CREATE TABLE [dbo].[User3]( [UserId] [int] IDENTITY(1,1) NOT NULL, [UserName] [nvarchar](200) NULL, [Name] [nvarchar](500) NOT NULL, [Email] [nvarchar](500) NULL, [Password] [nvarchar](500) NOT NULL, [Profession] [nvarchar](500) NULL, [AccountCategory] [nvarchar](200) NULL, [Gender] [nvarchar](500) NULL, [MaritalStatus] [nvarchar](500) NULL, [BirthDay] [date] NULL, [State] [nvarchar](500) NULL, [Country] [nvarchar](500) NULL, [ImageName] [nvarchar](505) NULL, [ImageBanner] [nvarchar](505) NULL, [RegisterdDate] [date] NULL, [UserStatus] [bit] NULL, [LastLogin] [datetime] NULL, CONSTRAINT [PK_User3] PRIMARY KEY CLUSTERED ( [UserId] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO ALTER TABLE [dbo].[User3] ADD CONSTRAINT [DF_User3_RegisterdDate] DEFAULT (getdate()) FOR [RegisterdDate] GO ALTER TABLE [dbo].[User3] ADD CONSTRAINT [DF_User3_LastLogin] DEFAULT (getdate()) FOR [LastLogin] GO </pre> <p>&nbsp;</p>http://www.aspforums.net/Threads/954159/Show-hide-Label-based-on-user-status-using-C-in-ASPNet/http://www.aspforums.net/Threads/954159/Show-hide-Label-based-on-user-status-using-C-in-ASPNet/Wed, 02 Nov 2016 01:55:01 GMTShow Hide ASP.Net AJAX Modal Popup in User Control from Page in ASP.Net<p>Hi,</p> <p>i have user control and in that i have ajax&nbsp; modalpopup extender</p> <p>now, i want to use this modal popup in my aspx.vb page like</p> <p>modalpopup.show()</p> <p>modalpopup.hide()</p> <p>than, how can i get the id of modalpopup from the user control and do this functionality</p> <p>&nbsp;</p>http://www.aspforums.net/Threads/208945/Show-Hide-ASPNet-AJAX-Modal-Popup-in-User-Control-from-Page-in-ASPNet/http://www.aspforums.net/Threads/208945/Show-Hide-ASPNet-AJAX-Modal-Popup-in-User-Control-from-Page-in-ASPNet/Mon, 28 Jan 2013 04:02:16 GMTSet Focus on a Button on TextBox Enter Key Press in UserControl in ASP.Net<p>Hi everyone,</p> <p>I have a User Control that I Made it as Login Control.</p> <p>and I put the User Control in MasterPage.</p> <p>and I have a ImageButton for rss in master page.</p> <p>when user fill username and password textboxes and Press Enter on keyboard the rss page appear instead.</p> <p>how can i set focus to Login Button in User Control?</p> <p>Thanks</p>http://www.aspforums.net/Threads/469100/Set-Focus-on-a-Button-on-TextBox-Enter-Key-Press-in-UserControl-in-ASPNet/http://www.aspforums.net/Threads/469100/Set-Focus-on-a-Button-on-TextBox-Enter-Key-Press-in-UserControl-in-ASPNet/Thu, 20 Dec 2012 05:52:36 GMTSession should not expire until user logs out in ASP.Net<p>Hello,</p> <p>how to maintain the session that does't expair&nbsp;&nbsp;unless and until user logout.&nbsp;</p>http://www.aspforums.net/Threads/151866/Session-should-not-expire-until-user-logs-out-in-ASPNet/http://www.aspforums.net/Threads/151866/Session-should-not-expire-until-user-logs-out-in-ASPNet/Wed, 23 Apr 2014 03:16:40 GMTSend user confirmation email after Registration with Activation Link in ASP.Net<p>i tried it using localhost knowning that is not host is it going to work? or the site most be hosted first because of the link?</p>http://www.aspforums.net/Threads/921003/Send-user-confirmation-email-after-Registration-with-Activation-Link-in-ASPNet/http://www.aspforums.net/Threads/921003/Send-user-confirmation-email-after-Registration-with-Activation-Link-in-ASPNet/Thu, 01 Dec 2016 11:22:47 GMTSend email to user when clicks Forgot Password button in ASP.Net<p>when user click forgot password it asked user name and email and send his password on his email.</p> <p>How implement this task in asp.net. with datbase sql server.</p> <p>reply me please ...</p> <p>provide me live demo or source code</p> <p>&nbsp;</p>http://www.aspforums.net/Threads/244031/Send-email-to-user-when-clicks-Forgot-Password-button-in-ASPNet/http://www.aspforums.net/Threads/244031/Send-email-to-user-when-clicks-Forgot-Password-button-in-ASPNet/Wed, 06 Feb 2013 08:04:22 GMTSend Approval email to user after Registration with Activation Link in ASP.Net<p>I asked my questions for three times and it couldn't send me the approval email???&nbsp;</p>http://www.aspforums.net/Threads/169227/Send-Approval-email-to-user-after-Registration-with-Activation-Link-in-ASPNet/http://www.aspforums.net/Threads/169227/Send-Approval-email-to-user-after-Registration-with-Activation-Link-in-ASPNet/Tue, 02 Aug 2016 02:28:43 GMTSelect Item in JavaScript when ImageButton is clicked in Datalist control in asp.net<p>Hi,</p> <p>I am using a datalist which contain image buttons. I want to know to selecte item in datalist in javascript. Please help me.</p> <p>Thanks in advance.</p>http://www.aspforums.net/Threads/155721/Select-Item-in-JavaScript-when-ImageButton-is-clicked-in-Datalist-control-in-aspnet/http://www.aspforums.net/Threads/155721/Select-Item-in-JavaScript-when-ImageButton-is-clicked-in-Datalist-control-in-aspnet/Wed, 25 Apr 2012 00:16:16 GMTSave user selected Language in Cookies in MultiLingual Website ASP.Net<p>i have read your article on aspsnippets.com</p> <p><a title="Multilingual Website" href="http://www.aspsnippets.com/Articles/ASPNet-Multilingual-website-Support-and-display-Multiple-Languages-English-French-in-ASPNet.aspx" target="_blank">Multilingual Website</a></p> <p>and i have implemented that i works good .</p> <p>but there is new problem arrising.</p> <p>suppose my default language is english set in internet option so the whenever website reloaded or redirected then all content will show in english language but</p> <p>when i changed it to hindi then current webpage converted to hindi but after that if i pressed any button on current page or i redirected to any other link of particular website then again hindi is converted to english.<br />so please give me solution for this so that untill i didn't change the language ,, all pages of that website langauge is same.</p> <p>&nbsp;</p>http://www.aspforums.net/Threads/158672/Save-user-selected-Language-in-Cookies-in-MultiLingual-Website-ASPNet/http://www.aspforums.net/Threads/158672/Save-user-selected-Language-in-Cookies-in-MultiLingual-Website-ASPNet/Fri, 31 Jul 2015 06:06:33 GMTSave User image and display on details Page in ASP.Net<p>i have one application form in which i want to store image of student with enrollment no and when i submit i want to store that image and take that image on another page on submit button two things should be done&nbsp;</p> <p>1. storing the image and enrollment no</p> <p>2. passing enrollment no and image to another page</p> <p>&nbsp;</p> <p>plz help me in this</p>http://www.aspforums.net/Threads/643183/Save-User-image-and-display-on-details-Page-in-ASPNet/http://www.aspforums.net/Threads/643183/Save-User-image-and-display-on-details-Page-in-ASPNet/Wed, 25 Dec 2013 22:04:31 GMTSave jpg on project folder instead of show to user<p>Hi,</p> <p>&nbsp;</p> <p>I have this code which is export div data to png its working fine.</p> <p>I want when click on button div export to png and save it on project folder as image and user just receive message that image save successfully.</p> <p>&nbsp;</p> <p>&nbsp;</p>http://www.aspforums.net/Threads/137400/Save-jpg-on-project-folder-instead-of-show-to-user/http://www.aspforums.net/Threads/137400/Save-jpg-on-project-folder-instead-of-show-to-user/Mon, 30 May 2016 09:49:08 GMTSave and Retrieve CheckBoxList values as per User Roles in ASP.Net<p>Hello everyone i need a script on ASP.net that can build this form.</p> <div> <div> <div> <div>1.Users === Drop Down Menu then in the Drop down should be the names of all Taafoo staff.<br /><br /><br /></div> &nbsp;2. when i choose from the Drop down list lets say Andrew ...once i select andrew it should display all the roles in Taafoo for example (Uploading, IT, Inventory, Sales etc)&nbsp; in form of a check Box or Option Button. then the roles assign to me will be checked while those not assign wont be checked.</div> Then lastly an UPDATE button that when Andrew is been moved to sales ,,,since sales was not checked and i later checked ite an and clicked Update it should updat<br />e and save.<br /><br /><br /></div> Thats all<br /><br /></div> <p>Thanks</p>http://www.aspforums.net/Threads/679370/Save-and-Retrieve-CheckBoxList-values-as-per-User-Roles-in-ASPNet/http://www.aspforums.net/Threads/679370/Save-and-Retrieve-CheckBoxList-values-as-per-User-Roles-in-ASPNet/Wed, 26 Feb 2014 07:14:34 GMTRich textbox in ASP.net<p>Hi,</p> <p>I am new to ASP.net, I want to have rich text box in project I am doing to accept formatted &amp; tabular data.&nbsp;&nbsp; Should be able to add many small rich text box in the page.&nbsp; Please suggest.</p> <p>Regards,</p> <p>Darshan</p> <p>&nbsp;</p> <p>&nbsp;</p>http://www.aspforums.net/Threads/179530/Rich-textbox-in-ASPnet/http://www.aspforums.net/Threads/179530/Rich-textbox-in-ASPnet/Fri, 16 Mar 2012 05:59:05 GMTRefresh a GridView inside UserControl On Button Click in ASP.Net<p>I have a Page (created using master page) it has a UserControl and i want to reload the UserControl on button click (button in page outside the UserControl). I do not want to reload entire page. I want to reload just the UserControl.<br /><br />ASPX:<br />&nbsp;</p> <pre class="brush: xml">&lt;asp:UpdatePanel runat=&#34;server&#34; id=&#34;UpdatePanel&#34; updatemode=&#34;Conditional&#34;&gt; &lt;Triggers&gt; &lt;asp:AsyncPostBackTrigger controlid=&#34;Button1&#34; eventname=&#34;Click&#34; /&gt; &lt;/Triggers&gt; &lt;ContentTemplate&gt; &lt;uc2:GetUserScraps ID=&#34;GetUserScraps1&#34; runat=&#34;server&#34; /&gt; &lt;/ContentTemplate&gt; &lt;/asp:UpdatePanel&gt;</pre> <p>I am not sure what to do on code behind.</p>http://www.aspforums.net/Threads/823346/Refresh-a-GridView-inside-UserControl-On-Button-Click-in-ASPNet/http://www.aspforums.net/Threads/823346/Refresh-a-GridView-inside-UserControl-On-Button-Click-in-ASPNet/Tue, 09 Apr 2013 06:54:10 GMTRedirect user to Login Page if not logged in ASP.NetHi, I am authenticating user on login page with custom username and password textbox from database if user user authenticated then it will redirect to main page, but how to check weather is logged in or not, if i open main page directly then it opens also, i want to check logged in user on page init or page load.http://www.aspforums.net/Threads/243118/Redirect-user-to-Login-Page-if-not-logged-in-ASPNet/http://www.aspforums.net/Threads/243118/Redirect-user-to-Login-Page-if-not-logged-in-ASPNet/Sun, 22 May 2016 22:47:39 GMTRedirect User to HTTPS ( Secured ) Connection if HTTP ( Unsecure ) connection is detected in ASP.Net<p>sir i have got ssl security for my website.I have written onLoad that www.mylifeshades.com Should redirect on https://mylifeshades.com .Sir it redirects but first the www.mylifeshades.com pages loads full and then after a sec it redirects...Sir i want to solve this</p> <p><span style="font-size: 9pt;">function(){</span></p> <p>windows.onload = windows.location.href("https://mylifeshades.com"<span style="font-size: 9pt;">)</span></p> <p>}</p>http://www.aspforums.net/Threads/105701/Redirect-User-to-HTTPS-Secured-Connection-if-HTTP-Unsecure-connection-is-detected-in-ASPNet/http://www.aspforums.net/Threads/105701/Redirect-User-to-HTTPS-Secured-Connection-if-HTTP-Unsecure-connection-is-detected-in-ASPNet/Tue, 12 Mar 2013 00:01:40 GMTRedirect user to different page based on logged in user in ASP.Net<p>Example if three different companies are using same login page but i want when company A login they will be directed to page A, When company B login they will be redirected to page B same goes with company C</p> <p>This is my login page</p> <p>&nbsp;</p> <pre class="brush: csharp">protected void ValidateUser(object sender, EventArgs e) { int UserID = 5; string constr = ConfigurationManager.ConnectionStrings[&#34;conn&#34;].ConnectionString; using (SqlConnection con = new SqlConnection(constr)) { using (SqlCommand cmd = new SqlCommand(&#34;Validate_User&#34;)) { using (SqlDataAdapter sda = new SqlDataAdapter()) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue(&#34;@Email&#34;, LoginINNOVATION.UserName); cmd.Parameters.AddWithValue(&#34;@UserName&#34;, LoginINNOVATION.UserName); cmd.Parameters.AddWithValue(&#34;@Password&#34;, LoginINNOVATION.Password); cmd.Connection = con; con.Open(); UserID = Convert.ToInt32(cmd.ExecuteScalar()); con.Close(); } switch (UserID) { case -1: // Login1.FailureText = &#34;Username or password not correct.&#34;; break; case -2: LoginINNOVATION.FailureText = &#34;Account has not been activated.&#34;; break; case -3: LoginINNOVATION.FailureText = &#34;Your Password.&#34;; break; default: FormsAuthentication.RedirectFromLoginPage(LoginINNOVATION.UserName, LoginINNOVATION.RememberMeSet); break; } } } } </pre> <p>&nbsp;</p>http://www.aspforums.net/Threads/595047/Redirect-user-to-different-page-based-on-logged-in-user-in-ASPNet/http://www.aspforums.net/Threads/595047/Redirect-user-to-different-page-based-on-logged-in-user-in-ASPNet/Mon, 03 Oct 2016 05:34:15 GMTRedirect to Page after fetching its URL from database in ASP.Net<p>HI</p> <p>I have <strong>House_info Table</strong> in database</p> <table border="1" cellspacing="0" cellpadding="0"> <tbody> <tr> <td valign="top" width="37"> <p>Id</p> </td> <td valign="top" width="66"> <p>Name</p> </td> <td valign="top" width="96"> <p>Behcode</p> </td> <td valign="top" width="96"> <p>Password</p> </td> <td valign="top" width="63"> <p>T_name</p> </td> </tr> <tr> <td valign="top" width="37"> <p>1</p> </td> <td valign="top" width="66"> <p>Sara</p> </td> <td valign="top" width="96"> <p>1111</p> </td> <td valign="top" width="96"> <p>1212</p> </td> <td valign="top" width="63"> <p>Store</p> </td> </tr> <tr> <td valign="top" width="37"> <p>2</p> </td> <td valign="top" width="66"> <p>Jack</p> </td> <td valign="top" width="96"> <p>2222</p> </td> <td valign="top" width="96"> <p>4545</p> </td> <td valign="top" width="63"> <p>Estate</p> </td> </tr> </tbody> </table> <p>and I have <strong>Admin.aspx</strong> page</p> <p>in this page I have <strong>EnterBTN</strong> Button and <strong>2 Textbox&nbsp;</strong> TxtBeh and TxtPass&nbsp; here users enter Behcode and Password and when they click on <strong>EnterBTN</strong> Button it go to other page</p> <p><strong>below is EnterBTN Event code</strong></p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <pre class="brush: csharp"> protected void EnterBTN_Click(object sender, ImageClickEventArgs e) { string data = Server.UrlEncode(Txtbeh.Text); SqlCommand _cmd = new SqlCommand(&#34;EnterStore&#34;, _cn); _cmd.CommandType = CommandType.StoredProcedure; _cn.Open(); _cmd.Parameters.AddWithValue(&#34;@Behcode&#34;, Txtbeh.Text); _cmd.Parameters.AddWithValue(&#34;@PassWord&#34;, Txtpass.Text); bool isValid = aspcap.Validate(Txtc.Text.Trim()); if (isValid) { int count = Convert.ToInt32(_cmd.ExecuteScalar()); if (count &gt; 0) { Session[&#34;Login&#34;] = true; Session[&#34;BehCode&#34;] = Server.UrlEncode(Txtbeh.Text); Response.Redirect(&#34;Managers.aspx?BehCode=&#34; + Server.UrlEncode(Txtbeh.Text)); } else { Session[&#34;Login&#34;] = null; Session[&#34;MessageError&#34;] = true; lblcap.Visible = false; } } else { lblcap.Visible = true; } _cn.Close(); Alert(); } </pre> <p>here if users enter <strong>correct Behcode and password</strong> it go to <strong>Manager.aspx</strong> page</p> <p>I want if users enter correct behcode and password if their <strong>T_name was =Store</strong> it go to <strong>Manager.aspx</strong> page And if their <strong>T_name was</strong>&nbsp;<strong> Estate</strong> it go to <strong>Estate.aspx</strong> page</p> <p>How I can do it ?</p> <p><strong>BestRegards</strong></p>http://www.aspforums.net/Threads/197029/Redirect-to-Page-after-fetching-its-URL-from-database-in-ASPNet/http://www.aspforums.net/Threads/197029/Redirect-to-Page-after-fetching-its-URL-from-database-in-ASPNet/Mon, 17 Jun 2013 07:12:36 GMT