....">
C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » ASP.NET »

Maintain the tap index during postback.


Posted Date: 21 Nov 2008      Posted By: Babu Kumarasamy      Member Level: Gold     Points: 1   Responses: 1



Hi,

This UpdatePanel is in master page.
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</ContentTemplate>
</asp:UpdatePanel>


In child page I am having a dropdownlist.

Another UpdatePanel in the same childpage. Which contains a tab. If I select the tab 2, I want it to maintain the same tab value until another tab is selected.

But the things is that if the user select the dropdownlist the tab is changing. I had set ChildrenAsTrigger = false; for the child UpdatePane.

Help me to solve the Issue.

Thanks in advance.





Responses

Author: Yousuf    23 Nov 2008Member Level: SilverRating: 2 out of 52 out of 5     Points: 6

Hi there

You can set the intial tab index by using the following code

Lets say i hava master page which has a button.

and i have a content page that has a 2 text boxes. Textbox1 has values nothing and Textbox2 has value = "Copy value to first text box and set focus" . when i click on button. my text box 2 value should be pasted with focus in the textbox 1

Note master page has and update panel

<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>


<asp:UpdatePanel ID="UpdatePanel1" runat="server">

<ContentTemplate>
<asp:Button ID="btnMasterPageButton" runat="server" Text="MasterPageButton" />
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</ContentTemplate>

</asp:UpdatePanel>

The code as follows ...

Code behind

Private Sub btn_UC_Main_button_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn_UC_Main_button.Click
'WANT TO WRITE CODE HERE ON CLICK SET FOCUS ON CONTENT'S (WEBFORM1.ASPX) PAGE TEXTBOX

Dim MyTxt As TextBox
MyTxt = CType(Page.Master.FindControl("ContentPlaceHolder1").FindControl("TextBox2"), TextBox)
CType(Page.Master.FindControl("ContentPlaceHolder1").FindControl("TextBox1"), TextBox).Text = MyTxt.Text
CType(Page.Master.FindControl("ScriptManager1"), ScriptManager).SetFocus(MyTxt.ClientID)
' ''Me.ScriptManager1.SetFocus(MyTxt.ClientID)


End Sub



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : Change the data type in back end using programatically
Previous : Make MS word as Read Only
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use