using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Data.SqlClient; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using Microsoft.ApplicationBlocks.Data; namespace GAVS.Asset.UI { /// /// Summary description for EditUser. /// public class EditUser : System.Web.UI.Page { protected System.Web.UI.WebControls.CustomValidator customValidator; protected System.Web.UI.WebControls.ValidationSummary vsErrors; protected System.Web.UI.WebControls.Label lblInfo; protected System.Web.UI.HtmlControls.HtmlAnchor lbReports; protected System.Web.UI.HtmlControls.HtmlAnchor lbUsers; protected System.Web.UI.HtmlControls.HtmlAnchor lbCategories; protected System.Web.UI.HtmlControls.HtmlAnchor lbProducts; protected System.Web.UI.HtmlControls.HtmlAnchor lbChangePassword; protected System.Web.UI.HtmlControls.HtmlAnchor lbLogout; protected System.Web.UI.WebControls.TextBox txtUsername; protected System.Web.UI.WebControls.TextBox txtPassword; protected System.Web.UI.WebControls.TextBox txtConfirmPassword; protected System.Web.UI.WebControls.DropDownList ddlRole; protected System.Web.UI.WebControls.TextBox txtEmail; protected System.Web.UI.WebControls.RequiredFieldValidator rfvUsername; protected System.Web.UI.WebControls.RequiredFieldValidator rfvPassword; protected System.Web.UI.WebControls.RequiredFieldValidator rfvConfirmPassword; protected System.Web.UI.WebControls.RequiredFieldValidator rfvRole; protected System.Web.UI.WebControls.RequiredFieldValidator rfvEmail; protected System.Web.UI.WebControls.CompareValidator cvConfirmPassword; protected System.Web.UI.WebControls.RegularExpressionValidator revEmail; protected System.Web.UI.WebControls.Button btnSave; private void Page_Load(object sender, System.EventArgs e) { if (! IsPostBack) { BindData(); } } private void BindData() { int userId = UserId; if (userId != 0) { rfvPassword.Enabled = false; rfvConfirmPassword.Enabled = false; SqlDataReader reader = null; try { reader = SqlHelper.ExecuteReader(Global.ConnectionString, "am_User_Get", userId); if (reader.Read()) { txtUsername.Text = reader["UserName"].ToString(); ddlRole.SelectedValue = reader["Role"].ToString(); txtEmail.Text = reader["Email"].ToString();
Syed Abdul Khader
Posts
-
Using same form for INSERT and EDIT -
TextBox width questionHow can we specify in aspx page that the TextBox control should occupy the whole width of its parent table cell?
-
SQL Ternary OperatorVery many thanks for your great answer, Colin
-
SQL Ternary OperatorIs there anything like C# style ternary operator in SQL?
-
Strange Error while ruuning Web ApplicationFrequently I am getting the below error. The error suddenly disappear without any change in the code or configuration. Then it appears again after sometimes. I am giving the error message. Anybody having solution to this problem. Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Parser Error Message: Access is denied: 'Microsoft.ApplicationBlocks.Data'. Source Error: Line 196: Line 197: Line 198: Line 199: Line 200: Source File: c:\winnt\microsoft.net\framework\v1.1.4322\Config\machine.config Line: 198 Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.ApplicationBlocks.Data' could not be loaded.
-
Input text for File Browse TextboxI used the same. It is not working. My requirement is the text "file.html" should come in the Textbox of the file browse control in browser. Thanks
-
Input text for File Browse TextboxI want to set some initial text in the textbox of the element. How to do? Thanks.
-
Setting initial text in HtmlInputFile controlI have to set some initial text in the HtmlInputFile control. How to do? Thanks.
-
DataGrid TemplateColumn ViewStateCan you post the code so that I can try.
-
Back IEUse javascript history.back method
-
DataGrid TemplateColumn ViewStateWhen you are adding the controls? You have to do it during ItemCreated event of the Datagrid. Then it will work. I dont know why.
-
Reset render method flag ????You are sending the page content as email for many ids. Thats what I understand from ur code. If you want to change the content, change the content of the html string in the loop. Hope I get your question correctly.
-
Reset render method flag ????When I test with the code I got the same error. I dont know the problem. In this case you can workaround this, if have understand your code correctly. I hope you want to email the page content to a set of email (the same content). Why u r getting the html to be sent in the email in the loop. Get the content before loop as string and then send it to all. Now the n time (loop) rendering reduced to 2 times (one for email and one for page rendering). Instead of calling base.Render for page rendering, you just use Response.Redirect to recreate the page. Hope this will help.
-
Unable to debug ASP.NET web applicationVisit the following link. It may be of useful to you. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsdebug/html/vxurferrorurlisininternetzone.asp[^]
-
Reset render method flag ????There is no such flag. If you post the code, I can see what the problem is.
-
Maximum Post Size of pageIs there any maximum size which can be posted through a page? What is the optimal size of the information that can be posted through a page for optimum speed, performance and server load?
-
Need help in JavascriptI created User Controls WebUserControl1 which contains a button. Another UserControl WebUserControl2 which contains the WebUserControl1. I am using the WebUserControl2 instance in a page. I added javascript code for click event of the Button in the page hosting the WebUserControl2. It is working perfectly.
protected override void OnPreRender(EventArgs e) { base.OnPreRender (e); Button btn = (Button) this.WebUserControl21 .FindControl("WebUserControl11").FindControl("Button1"); string jsStr = "alert('" + btn.UniqueID + "');return false;"; btn.Attributes.Add("onclick", jsStr); }
-
Default Web Application PathThe Web Application created using the path provided by New Project Dialog will be stored in c:\inetpub\wwwroot\MyWepAppName. If you want to store all your web applications in a directory like c:\syedwebapps you have to create a virtual directory using the iis before creating the web applications. But if use the default web application path you need not create any virtual directory. Basically my requirement is, I want to make some directory other than c:\inetpub\wwwroot to behave like wwwroot so that all the wep applications created will go to that directory without and additional need of creating virtual directory every time.
-
Locating and Extracting VS.Net Icons for Pluggin useI dont know whether it will breach the copyright law or not. The icons have been in the assembly itself as a resource. You can use the tools like .NET Reflector to see the icons. An easy way, make a screenshot and cut it from it
-
Need help in JavascriptYou generate the javaascript in page cs file instead of hardcoding in the aspx page like this.
string jsStr = "this.form['" + yourControlVar.UniqueId + "']. value..."