|
-
Jul 27th, 2007, 01:16 PM
#1
Thread Starter
Addicted Member
[2005] Controls and Hyperlinks
Is there a way to keep a control on a page when a hyperlink is clicked, so the new page loads below my control? Or do I need to use frames to do this? If so is there something in Visual web developer to create frames? Thanks.
-
Jul 28th, 2007, 10:16 AM
#2
Re: [2005] Controls and Hyperlinks
You could use MasterPages and have your control sit on every page while the rest of the page 'changes' in the ContentPlaceHolder
-
Jul 30th, 2007, 12:09 PM
#3
Thread Starter
Addicted Member
Re: [2005] Controls and Hyperlinks
Ahh very good. thanks. half the battle is knowing what work to search for. Ive spent the morning getting this master page figured out. This brings up two new issues I cant find.
1) my master page has a control with some dropdownlists, when the pages change the dropdownlists in my control are being reset. How do i make the control(or the master page) NOT reload everytime the page changes.
2) im using these dropdown lists to supply data to a text box the 'child' pages (not sure if that the correct term). The text boxes dont update immediatly they are one selection behind the dropdown lists. So i select a drop down. and the text box gets the value that was previously in the dropdown.
Any help would be greatly appreciated, even some key words to search for? Thanks.
Last edited by Samir Nagheenanajar; Jul 31st, 2007 at 11:19 AM.
Reason: forgot the NOT
censored
-
Aug 1st, 2007, 10:22 AM
#4
Re: [2005] Controls and Hyperlinks
1) Do a search on Page.IsPostback, where you can prevent the refilling in of the dropdownlists.
2) I'll need to see code.
-
Aug 1st, 2007, 11:12 AM
#5
Thread Starter
Addicted Member
Re: [2005] Controls and Hyperlinks
Im half way to solving the first issue. It successfully repopulates the DDL so it displays the correct value but the actual value of the DDL is reset to its default. here is my code
Code:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'if its not just a post back fill boxes with session variables
If Not IsPostBack Then
officeDrop.SelectedValue = Session("officeSess")
MsgBox(officeDrop.SelectedValue) 'check that the value is correct this shows that the value is its default %, and not what is being displayed in the DDL
districtDrop.SelectedValue = Session("districtSess")
planningAreaDrop.SelectedValue = Session("planningareasess")
End If
updateSessionData()
End Sub
..........
Protected Sub updateSessionData()
TextBox1.Text = officeDrop.SelectedValue
TextBox2.Text = districtDrop.SelectedValue
TextBox3.Text = planningAreaDrop.SelectedValue
'stores office, district, and planning area as session
'variables so they are available on other pages
Session("officeSess") = officeDrop.SelectedValue
Session("districtSess") = districtDrop.SelectedValue
Session("planningAreaSess") = planningAreaDrop.SelectedValue
End Sub
edit: I think the problem is the control just needs reloaded or refreshed because i put a button to display the DDL value and when i click the button the screen flashes and the text boxes display the correct information. What event is happening to refresh the text boxes, how do I call it?
Last edited by Samir Nagheenanajar; Aug 1st, 2007 at 11:34 AM.
censored
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|