When i debug your code, i got the following statement:
select Vpath, path, FileName, size, write, attrib, SUBSTRING(Characterization,90,DATALENGTH(Characterization)-1) as Characterization, DocTitle, rank from scope('shallow traversal of \"/Software\",\"/Industries\",\"/\"') where FREETEXT(contents,'abc') and FileName NOT LIKE 'inc_%' and FileName NOT LIKE '%.js' and FileName NOT LIKE 'searchresult.aspx' and FileName NOT LIKE '%.css' order by rank desc
I have a menu in Default.aspx, based on the menu clicked corresponding user control is loaded dynamically using LoadControl(). This User control loaded has a formview control in which a dropdown and a textbox are present. When i set the autopost back property of the dropdown to true and select an item in it. The User control which is loaded is disappearing.
I have found that the page_load event of the Defualt.aspx is called.
I have used Ajax too..but it didn't help me. Can anyone help me ?
As AlexeiXX3 mentioned, dynamically generated controls are not recreated after the page postbacks.
The thing is that the postback resets the page to it's original state, so any information regarding the dynamically created controls is lost. Why is that? Because the Page class is stateless. The Page recreates child controls based on the tags in the aspx files, so your controls not being present there are not shown. What you need to do is recreate the controls in the OnInit event or any event that fires before PageLoad, or in PageLoad if you do a check to see is the page is posted back. See this article[^] as an example.
The thing to keep in mind is that when recreating the controls to assign them the same ID they previously had. This way you will retain the state of the controls. That's because when you postback a page the values of the controls are saved in the viewstate, but when state is restored to the controls, it actually looks for the controls with the coresponding ID's on the page. If it can find them it will restore them. So you don't have to worry about state as long as you recreate your controls correctly.
"Pay people peanuts and you get monkeys" - David Ogilvy
For Each ctrl As Control In panelInternational.Controls
If TypeOf ctrl Is RadioButton Then
Dim radio As RadioButton = CType(ctrl, RadioButton)
'Do what you want with radio variable wich has a control
In this example, im using radiobuttons and not htmlradiobuttons
If you are adding many radiobuttons to the panel i would recomend using a radiobuttonList (And add all the options you need to a single control)
Then to retrieve the selected value, Just use radiobuttonList.selectedValue
I have a DetailsView where there is a DateTime field in an InsertItemTemplate. Im using a popup type calendar located in another aspx page. When a date is selected, the value populates a TextBox in the Parent window.
I saw your other reply, DONT MAKE ANOTHER POST
Or was it an App Error here at codeproject?
I didnt really understand what you said on that post, please clarify
Just to see if it works
0- Run your page and switch the detailsview to insert mode
1- Rightclick the page > select view source
2- Find the textbox control name in the html source
I am passing a session variable (bookID) from Page 1 to Page 2 and I have it displaying as a label on Page 2. However, I am needing to display a gridview2 on the second page for books that have Book Reviews based on that bookID (the one i passed from Page 1 to Page 2). If I need to explain any further please ask I don't mind.
I would like the gridview2 on page two, to have a column displaying book reviews just for that particular bookID (that was chosen on the gridview1 on page one..after the user clicks on the button in the gridview). Help is very much appreciated!! Thanks!
Sure, why not.
Whether you are using a SqlDataSource, or DataReader or DataSet - use your bookID in the SQL statement, make this SQL the SelectCommand for your data source, associate the GridView with the data source, bind the data.