Am working on asp.net with using vb.net i have a one form where is some disable textbox am assign the value on page load.user some time change it using f12 or some another way. So i don't want to change it any way if textbox is disabled.
My textbox name is txtUsername which is disable on Page load
My Code is
txtUsername.Enabled=false
'here amn getting value from database.
Dim strName as string ="Xyz"
but some user change the name "abc" and click on save then it update my database.
So i don't want to change it.
Thanks.
Related
DetailsView1 shows master detail from selected record of GridView1.
In edit mode, I have included a functionality for search, where on user click, GridView2 visibility is enabled.
I would like to have data from a selected row value (eg "accountnumber") from GridView2 loaded into a textbox control in DetailsView1 when I want to update "accountnumber".
How can I achieve this using VB.NET?
I put together a few ideas to come up with this, which worked perfectly well.
Dim TextBox As TextBox = TryCast(DetailsView1.FindControl("TextBox1"), TextBox)
TextBox.Text = GridView2.SelectedRow.Cells(0).Text
Alter the following form.
admin/config/system/site-information
Add a textbox in the site details section, below the email address textfield. The name of the textbox should be site_organisation.
Save the value entered in this textbox in a variable when the save configuration button is clicked.
The saved value should be displayed when the page is reloaded.
How can i do that? which module used for that?
Those are forms so you could use hook_form_alter to alter those forms:
https://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_form_alter/7
Also, check out this article:
https://www.drupal.org/node/1988004
I am currently developing a custom role/permission system...
I have a user control with all my permissions already and i want to re-use it for my custom role editor.
So right now I have a dropdownlist of the custom roles and a textbox to edit the name. What I want to do is...everytime a new value is selected in the dropdownlist the page to refresh and re-load my permission control with the RoleID and RoleName properties to be set to the DDL.SelectedValue and the textbox.Text like so...
<RSIPD:Permissions ID="Permissions" RoleID="[lstBaseRoles.SelectedValue]" RoleName="[txtCustomRoleName.Text]" runat="server" />
I know I am probably going about this the wrong way as I am more familiar with MVC3 than traditional ASP.NET Webform and am still learning.
This can be done in the code behind:
Permissions.RoleID = lstBaseRoles.SelectedValue
Permissions.RoleName = txtCustomRoleName.Text
This code would need to be called in the SelectedIndexChanged event of your DropDownList, and the TextChanged event of your TextBox.
I have the following situation:
I coded a aspx app c#, the user has 4 dropdownlists, one textbox and two buttons (cancel, save) in a page. I need the user to be remembered to save any changes to the textbox before allowing him to change the index of any dropdownlist. So, if the user changes the textbox value, he only have the option to cancel or save those chhanges. If he tries to do something else, like changing the index of a dropdownlist, I need to cancel this event and give him a message to save or cancel before do this.
I've tried many ways, but they all seem amatours to me and give lots of colateral efects. Is there any decent/elegant way to do this?
Create a custom validator for the TextBox. In the DropDownList's SelectedIndexChanged event handlers check the status of the TextBox and set the validator's args.IsValid property appropriately - you can notify the user via the TextBox CustomValidator ErrorMessage property to click Save if the value of the TextBox has changed.
I am creating a form in my website and i link this form to the google docs (FORM which i created there). But this new form that i am trying to do is this in such a way that a textbox value from the first page should be passed over to the next page lets say page2 textbox value
CODE IS ROUGHLY SOMETHING LIKE THIS
PAGE 1.html,aspx,asp (Watever)
"/>
Page2.html,aspx,asp (Watever)
**readonly**"/>
So since i am using the google docs to save my data
**
form action="http://docs.google.com
i am unsure how to pass these values, tks for the help.
Presently i am just getting the values from page1 to page2 using this microsoft tutorial
http://support.microsoft.com/kb/300104
I think you need to read
How to: Pass Values Between ASP.NET Web Pages
you can store values using the approaches listed there.
Eg:
On your Page 1:
Create a textbox named textbox and an asp button.
on button.click code behind add
Session["test"] = textbox.Text;
Response.Redirect("Page2.aspx"); //Open page 2
On your Page 2 :
Creata a label named label1
Then on its Pageload Event in code behind
Add
string IpassAstringfrompage1 = Convert.ToString(Session["test"]);
label1.Text = IpassAstringfrompage1; //label1 will display TESTING from textbox on Page1
To test. On Page1 input "TESTING" on your textbox then click button
Regards