when loading a previously created record on to form, some controls are missing values(controls are depended on values selected in other controls)
Hello - I have created a page for Editing records. this page will open up a chosen record and allow user to edit the data.On the form, I have 3 drop down lists. The second dropdown list should fill values depending on value chosen in first dropdown list. The third dropdown list should show/fill values depending on value chosen in second dropdown list.So taking this into count, i have several records with various data. When I open-up/load a record in Edit form, only the first dropdown list has a value selected that was the pre-existing va...
Passing values from a parent web control to child web control
I have a parent control which called CONTROL1 and a child control witch called CONTROL2 I would link to pass a value from the parent control to the child control. In the parent control(CONTROL1) I have the following Event Handler .
private void btn_Handler(object sender, EventArgs e) {
…
if (Page.IsPostBack) {
// Send the officer names to the child controls.
if(m_nameList.SelectedItem.Text != "")
 ...
Clearing Web Controls Values from a Web Form
I have a web form and after a user submit it I want to clear the form so that they may submit another entry.
I have seen examples in VB of how to loop thru a web form and clear the controls, but I need a C# solution.
I have tried the following code, while it does not give me an error, it does not clear the controls on the form.
Any suggestions? Thanks!
foreach (Control parent in Page.Controls)
{
foreach (Control child in parent.Controls)
...
Pass 1 control value to another control value
I have this form, is the detailsview, and in edit mode, I have a link
that you click to open up a small dhtml window (not a new window but
more like a layer so everything is on the same page). When I
select an item from the dhtml window, it puts the value into a
textbox. I then have a button I click and I want to pass that
value from that textbox to the textbox in the detailsview. When I
click the button, the value is not passed.
Here is the code I use for getting the value from the dhtml window and assigning it to the detailsview textbox:
If e.CommandName = "pi...
Retreiving a value from a web form within a web user control
Hi
I have a page (web form) that retreives some data from a database. To be more specific: at some point when user clicks a button (in the web form) there is some ID number retreived from a database in code behind. At the same time the Visible property of the nestet web user control is chamged to true. I want than forward the ID to the web user control so that a grid view can load data from a database for that ID.
How can I access that data (the ID) within a web user control context nested in that page?
Kind regards
Check this ;ink
http://www.codeproject.com/K...
Web custom control does not maintain values of child controls
Hello everybody A few days now, I am struggling with a custom web control I am creating, which consists of 3 drop down lists (country/city/hotel).Procedure is simple: On country change, I have to fill the cities with autopostback, and on city change I have to fill hotels again with auto postback. I tried many many methods and I am confused... The best I managed to make is keep the state of countries, and render it with the selected country, selected while filling cities with apporpriate data, however I cannot manage to do the same with the cities/hotels since sities does not keep selected va...
Setting the Parameter Value to the Property Value of a Web Control
I want to filter my DetailsView with a declarative parameter. In my case, I am setting the SqlDataSource's parameter values based on the value of 2 TextBox controls on the page.
I have a SP that does a SELECT based on 1 of the parameters passed in (either an ID or phone number).
Param Name Value MemberID TextBox1.Text Phone TextBox2.Text
I want to assign a default value of 'null' for b...
Controlling web control instances on Web Form
I have created a composite control, extending functionality of the Hidden Control. However, I would like to prevent the user from adding this control to the page multiple times. I only want one instance of the control on the Web Form. What setting in my project to I adjust to enable this functionality? I can not find it in any of the books that I have referenced. Is this a setting or is this code that has to be added to the inheriting class.
Looks like there is no standard apporach. But I'd consider using static field to count number of created objects and throw exception if second object ...
How to maintain form controls value after user control post back?
hello experts, I have created filter grid in asp.net & C#.My form design has contains 3 dropdown controls and Filter grid(User control).Its working fine(filter), but one problem arise.the form controls are clear when i filter a grid(post back).I tried to reterive values using view state, hidden controls, i got only null values.Anyone please help, its urgent to me. Its my user control code.FilterGrid.aspx<%@ Control Language="C#" AutoEventWireup="true" CodeFile="FilterGrid.ascx.cs" Inherits="FilterGrid" %><style type = "text/css&...
values of web controls in user control can not be access from other pages???
I have aspx page(brief code: includes ascx file)
<%@ Register Src="reseller.ascx" TagName="reseller" TagPrefix="uc1" %>
<form id="form1" runat="server">
<uc1:reseller ID="idreseller" runat="server" />
</form>
the code for asxc file . i have the PostBackUrl to reseller.aspx
<asp:TextBox ID="txtPostCode" runat="server" CssClass="form1" Width="50" MaxLength="4" />
<asp:ImageButton ID="ibtn" ImageUrl="images/searchbutton.jpg" PostBackUrl="~/reseller.aspx" runat="server" />
In my reseller page i try to read the post value of control txt...
How to get the HREF value of the Anchor tag in a web page using the web browser control in vb.net
Hi Friends,
i have a webserver control in my application.i load the web browser control on a button click using the below code
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
AxWebBrowser1.Navigate("http://www.rateitall.com/i-322335-.aspx", False)
End sub
once the page is loaded in the browser i want the <a> HREF value in that page.For example if that page has ...
How to retrieve web form values with a Webbrowser control
Hi all,
From a stand alone applicaiton written in visual basic, how can I retrieve values form a asp.net form using the WebBrowser control?
jsn1:
Hi all,
From a stand alone applicaiton written in visual basic, how can I retrieve values form a asp.net form using the WebBrowser control?
Hi jsn1,
Try to use following code to solve your problem,
Me.webBrowser1.Document.All("UserId").GetAttribute("value")
Hope it helps,
Hong Gang
Hong-Gang ChenMicrosoft Online Community SupportPlease remember to mark the replies as answers if they help and ...
Problem in Passing controls values between web forms
Hi friends i have problem with my .aspx application inwhich i want to store the values of controls in a webform to the variables in the other one. My application is like, i have a mainpage in which i have an <IFRAME>, into which i call other 3 .aspx pages one by one using links. Now i wants to save the values of controls in those all three child page in my mainpage variables and from that i want to store them in database. Please help me ou...
Passing values to a Windows Control in a Web Form
I have created my grid in windows and am hosting it in an asp.net page. My question is can I pass session variable to the winform from my asp.net form and vice versa?
Any help is greatly appreciated
I don't believe you are able to do this as a session variable. Now I might not be accurate in my terminology here but I think it because of how session states are handled. They are in two seperate system processes (or pools).
So for instance, when a user launches your asp.net form, it uses the aspnet_wp.exe.When a user launches your web form, it uses your project.exe
Both of thes...