Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
C

Cyberpulse

@Cyberpulse
About
Posts
14
Topics
11
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Error retrieving password
    C Cyberpulse

    Hi, I have an application in which I am trying to retrieve a user's password. The code is as follows:- 1 MembershipUser resetPass = MyUsers[UserInfo.Rows[e.NewSelectedIndex].Cells[0].Text]; 2 string password = resetPass.GetPassword(); However on execution I am hit with the following error:- This Membership Provider has not been configured to support password retrieval. I have tried the following steps to resolve this issue but to no avail:- In the WebConfig in I have modified the <Membership></Membership> tag to reflect the following:- <membership> <providers> <clear/> <add name=”AspNetSqlMembershipProvider” connectionStringName=”247Db” minRequiredPasswordLength=”4″ minRequiredNonalphanumericCharacters=”0″ type=”System.Web.Security.SqlMembershipProvider” applicationName=”/247App” enablePasswordRetrieval=”true” requiresQuestionAndAnswer=”false” passwordFormat=”Encrypted” requiresUniqueEmail=”false” /> </providers> </membership> I also added a machineKey to support the setup above as follows:- 1 <machineKey validationKey="11D7D8362528F04266ACACDDEA7..." 2 decryptionKey=”4C0…” 3 validation=”SHA1″/> However, now i get the following error:- "Hashed passwords cannot be encoded". I am guessing this is because the passwordFormat property in the web.config was "Hashed" befrore I changed it to Encrypted. Nevertheless, what should I do ? Thanks

    ASP.NET

  • Update rows in a gridview
    C Cyberpulse

    I have a gridview that I am populating with data based on user values in a textbox from the code behind. I have the gridview working correctly upto the point of displaying relevant data, making the selected row editable when the 'edit' link next to the corresponding row is clicked and cancelling the editable row so that reverts back to display mode. The problem is updating. How do I save the changes made to a specific row in edit mode once I hit the update link. My code is as follows:- 1 public partial class UserLockouts : System.Web.UI.Page 2 { 3 public SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["xyz"].ConnectionString); 4 public static int uniqueStoreId = 0; 5 public static int storeId = 0; 6 public static int userId = 0; 7 protected void Page_Load(object sender, EventArgs e) 8 { 9 10 } 11 12 protected void btn_Search_Click(object sender, EventArgs e) 13 { 14 bindGridView(); 15 } 16 17 protected void bindGridView() 18 { 19 if (tb_UniqueSN.Text != string.Empty) 20 { 21 conn.Open(); 22 string strSQL = "SELECT [StoreId] FROM [ac_StoreSettings] WHERE ([FieldValue] ='" + tb_UniqueSN.Text + "')"; 23 SqlCommand cmd = new SqlCommand(strSQL, conn); 24 Object myData = cmd.ExecuteScalar(); 25 uniqueStoreId = Int32.Parse(myData.ToString()); 26 storeId = uniqueStoreId; 27 conn.Close(); 28 } 29 30 else if (tb_StoreID.Text != string.Empty) 31 { 32 storeId = Int32.Parse(tb_StoreID.Text); 33 } 34 35 else if (tb_UserID.Text != string.Empty) 36 { 37 conn.Open(); 38 string strSQL = "SELECT [UserId], [IsLockedOut] FROM [ac_Users] WHERE ([UserId] =" + Int32.Parse(tb_UserID.Text) + ")"; 39 SqlCommand cmd = new SqlCommand(strSQL, conn); 40 DataTable dt = new DataTable(); 41 SqlDataAdapter sqlAdapter = new SqlDataAdapter(null, conn); 42 sqlAdapter.SelectCommand = cmd; 43 sqlAdapter.Fill(dt); 44 conn.Close(); 45 try 46 { 47 grd_Users.Data

    ASP.NET design help question announcement

  • Editing rows in a GridView
    C Cyberpulse

    I am not using any AJAX. the data being returned is not more than 10 rows.

    ASP.NET question lounge

  • Editing rows in a GridView
    C Cyberpulse

    I have a gridview that is being dynamically populated with data based on textbox values at runtime. The code inside the button click is as follows:- 1 conn.Open(); 2 string strSQL = "SELECT [UserId], [IsLockedOut] FROM [ac_Users] WHERE ([UserId] =" + Int32.Parse(tb_UserID.Text) + ")"; 3 SqlCommand cmd = new SqlCommand(strSQL, conn); 4 DataTable dt = new DataTable(); 5 SqlDataAdapter sqlAdapter = new SqlDataAdapter(null, conn); 6 sqlAdapter.SelectCommand = cmd; 7 sqlAdapter.Fill(dt); 8 conn.Close(); 9 try 10 { 11 grd_Users.DataSource = dt.DefaultView; 12 grd_Users.DataBind(); 13 pnl_Users.Visible = true; 14 } 15 catch (Exception ex) 16 { 17 TestUtils2.TestLogger.WriteErrorEntry(ex.Message, AuctivaUtils2.eAuctivaLogFile.General); 18 } 19 finally 20 { 21 conn.Close(); 22 } The gridview is correctly populated with the data I need, however I want each row in the data that is returned to be editable. I have the AutoGenerateEditButton property set to true and have also set the DataKeys property of the the gridview with the primary key of the table being returned. However when I click the 'edit" link that appears in each row in the gridview, nothing happens. How do I make that button make the corresponding row editable ?

    ASP.NET question lounge

  • Dropdownlist items keep duplicating [modified]
    C Cyberpulse

    I have a dropdownlist whose items are populated dynamically on a button click. I have a gridview being populated with values depending on the value selected in the dropdown list. The problem is that each time the SelectedIndexChanged event is fired the items in the drop down list are duplicated. I cannot use a if(!Page.Postback) block around the dynamic creation of the dropdown's list of items because that occurs on a button click so the page needs to be posted back the first time otherwise the items won't populate. Also, once it duplicates the items if I click on any of the items in the list ... the dropdownlist completely disappears from the page. Any ideas on what I should do ?

    modified on Thursday, October 16, 2008 5:54 PM

    ASP.NET help question

  • Timing the call of a .js file
    C Cyberpulse

    Yea, in a way I guess I am. I am basically working with a Javascript based HTML editor on which I have created a custom button, on that button's click event I want the contents of the editor (which is developed purely in javascript) to be transferred in to a .NET string that I can use to continue my logic. So this attempt is in view of one of the solutions I have thought of for that problem.

    ASP.NET javascript help question

  • Timing the call of a .js file
    C Cyberpulse

    I have a reference to a .js file on a masterpage that my Defaut.aspx is using. I need a value from that javascript file that is being set when the file loads, however I need that value prior to the page load of Default.aspx. My problem is that all the referenced .js files on the Masterpage are called after the Page_Load() event of Default.aspx. Is there a workaround for this ? Thanks.

    ASP.NET javascript help question

  • Dynamically adding a control to a content page
    C Cyberpulse

    How do you dynamically add a control (e.g. a textbox) to a ASP .NET content page in VS 2008. this.controls.add(new TextBox()); Does not work. Neither does Content cnt = (Content)this.FindControl("Content1"); cnt.Controls.Add(new TextBox());

    ASP.NET csharp visual-studio

  • Page_PreInit()
    C Cyberpulse

    The Page_PreInit() method should be invoked before the Page_Load() is called right ? As per the ASP .NET Page lifecycle PreInit is before Load. However when I try to debug that is not the case. My code in Page_PreInit() never gets called and the execution is passed directly to Page_Load(), Any suggestions ?

    ASP.NET csharp debugging question

  • LoggedInTemplate
    C Cyberpulse

    I have a Label control inside the LoginView's LoggedInTemplate. How do I access it ? I've tried the following:- Label lbl_Role = (Label)LoginView1.FindControl("Label1"); But it returns nothing. When I checked the properties of the label in the design view its path read as:- LoginView1.LoggedInTemplate.Label1 However, the LoginView1.LoggedInTemplate property does not have a FindControl() method. Is there anyway in which I can access the Label ? Thanks

    ASP.NET question design

  • ImageButton in a GridView
    C Cyberpulse

    Thanks a ton.

    ASP.NET help

  • ImageButton in a GridView
    C Cyberpulse

    I have an ImageButton in the Item Template of the fourth column of a gridview. I am trying to access it in the *.aspx.cs file but am unable to do so. I need this button to pass it as a parameter to a method and have tried multiple routes including this one which seemed like something that should have worked:- (ImageButton)Gridview.FindControl("EditButton"); "EditButton" is the name of the ImageButton Could anyone help me out. Thanks, Sudeep

    ASP.NET help

  • Flyouts
    C Cyberpulse

    I have a dropdown list with a few items in it. I am developing a control in which whenever a user mouses over an item in the list a flyout containing a couple of buttons appears dynamically. Could someone help me understand how I should go about implementing this. Thanks, Sudeep

    ASP.NET help

  • Controlling page elements from a .config file
    C Cyberpulse

    Is there a way to create a config file that controls the elements on specific pages. For example I have 2 pages viz. page1.aspx and page2.aspx. I want to have a config file in which I can control the visible property of the textbox controls on both pages. Something like this:-

    <page id = "page1.aspx">

         <controls>
    
             <control1 ID = "Textbox1" Visible = "false">
    
         </controls>
    

    </page>
    <page id = "page2.aspx">

         <controls>
    
             <control1 ID = "Textbox1" Visible = "true">
    
         </controls>
    

    </page>

    ASP.NET tutorial
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups