JScript for the .NET Framework


ClientID of a textbox in ContentTemplate of CreateUserWizardStep


Hi!I have a testbox in an .ascx file. The code is below.<asp:CreateUserWizard ID="CreateUserWizard1" runat="server" OnCreatedUser="CreateUserWizard_CreatedUser" RequireEmail="false">            <WizardSteps>                <asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server">                    <ContentTemplate>                        <asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False" /><br />                        <fieldset class="mscs-formInputs">                            <table id="Table1"><tr><td><asp:TextBox ID="FirstName" Text="First Name" runat="server" MaxLength="100"  /></td></tr></tr></table></fieldset></ContentTemplate> </asp:CompleteWizardStep> </WizardSteps>        </asp:CreateUserWizard>
in the code behind .ascx.cs file the FirstName is accessed as below.TextBox firstNameControl = this.CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("FirstName") as TextBox;If I directly access FisrtName in the codebehind. It is giving null, so I am accessing by the above way.in the ascx file I want to access the ClientID of the FirstName, how can I access it.in general we access as say if there is an ordinary textbox in a simple table control we access as below.<script type="text/javascript">  var txtUsernameID = '<%= txtUsername.ClientID %>';I want to know how I can access "FirstName" textbox which is in a CreateUserWizard.I appreciate your help.Thanks and regards,Usha.
Hello Usha,
We should enable the  "Customize Create User Step" before we can get the Textbox using FindControl, see Nai-Dong Jin's reply here,http://forums.asp.net/t/1175378.aspxAnd we should make sure we use the right name for that textbox. Your codes look fine to  me.By the way, this question is more at ASP.NET site instead of JScript. So if you need future help, trying to post in ASP.NET forum may let you get more ASP.NET experts' responses.
http://forums.asp.net/145.aspxHave a nice day! 
Ji Zhou
MSDN Subscriber Support in Forum
If you have any feedback on our support, please contact msdnmg#microsoft.com
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Hello Usha,
We should enable the  "Customize Create User Step" before we can get the Textbox using FindControl, see Nai-Dong Jin's reply here,http://forums.asp.net/t/1175378.aspxAnd we should make sure we use the right name for that textbox. Your codes look fine to  me.By the way, this question is more at ASP.NET site instead of JScript. So if you need future help, trying to post in ASP.NET forum may let you get more ASP.NET experts' responses.
http://forums.asp.net/145.aspxHave a nice day! 
Ji Zhou
MSDN Subscriber Support in Forum
If you have any feedback on our support, please contact msdnmg#microsoft.com
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Hi! Ji Zhou,Thanks for your reply. Now it is working for me as you had rightly suggeted in the forum link, I had casted the textbox and got lits ClientID as below.var FirstNameClientID ='<%= (TextBox)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("FirstName").ClientID %>';Have a nice day.Thanks and regards,Usha.
Hello Usha,
We should enable the "Customize Create User Step" before we can get the Textbox using FindControl, see Nai-Dong Jin's reply here,
http://forums.asp.net/t/1175378.aspx
And we should make sure we use the right name for that textbox. Your codes look fine to me.
By the way, this question is more at ASP.NET site instead of JScript. So if you need future help, trying to post in ASP.NET forum may let you get more ASP.NET experts' responses.
http://forums.asp.net/145.aspx
Have a nice day!
Ji Zhou
MSDN Subscriber Support
in Forum
If you have any feedback on our support, please contact
msdnmg#microsoft.com
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
The link you provided is very
useful, This is what I'm looking for.

Related Links

To display a Yes/No dialog box after reading a file !!
Is there a VBScript for .NET?
Microsoft.JScript.Vsa.VsaEngine
HOWTO set a AJAX:TabContainer's height in javascript at run time.
Consume Web Service with Transport Layer Security (HTTPS) from JavaScript
Multi-threading in javascript
Click handler on popup does not run properly in a .NET environment
How to update ASP.NET image control periodically?
Format date before SQL Query execution
Alert window in aspx page.
Class doesn't support automation - or - how to install WS 5.7 on an XP SP3
how to do validation in cshtml (MVC)
How to implement IObjectSafety programmatically in JScript.NET
Reports and Graphs - JQuery
MENU bar like forbes.com
alert window close when forms data changed

Categories

MSDN
DevLabs
Learning
Microsoft Sync Framework
Dynamics
Feedback and Discussions
Orchard
Open Specifications
Microsoft Azure
Archived Forums E-H
Archived Forums N-R
Kinect for Windows SDKs
Microsoft R
Forums Issues (not pro...
Off-Topic Posts (Do No...
Visual Studio General ...
MSBuild
Visual Studio Tools fo...
Developing Universal W...
Windows App Studio Beta
Application Compatibil...
Windows Desktop Search...
Windows Filtering Plat...
Windows Desktop Web Se...
Development with the W...
SharePoint 2013 - Deve...
SharePoint 2010 - Usin...
SharePoint 2010 - Search
SharePoint 2010 - Setu...
SharePoint Legacy Vers...
Cloud Services (Web an...
Azure Multi-Factor Aut...
Azure Virtual Machines
Azure Mobile Apps
Azure HDInsight
Azure Automation
Azure Marketplace
Azure Key Vault
Azure Logic Apps
Azure Stack
.NET Framework Class L...
Windows Presentation F...
Windows Workflow Found...
Team Foundation Server...
Visual FoxPro General
BizTalk Server Adapter...
ADO.NET DataSet
ADO.NET Entity Framewo...
The Forum of Sho
TPL Dataflow
Debugger Canvas
ISV Open Discussions
Microsoft Robotics - D...
SQL Server SMO/DMO
SQL Server Database En...
Getting started with S...
SQL Server Migration
SQL Server Master Data...
Power Pivot
SQL Server Data Qualit...
SQL Server Data Tools
Windows Embedded 8.1 I...
SQL Server 2012 Spatia...
Windows Forms Data Con...
Bing Maps General
Bing Maps Web Controls
Open Specifications Qu...
Designing with Silverl...
Reference Source Serve...
Retired SharePoint Bus...
Retired InfoPath Forms...
Retired SharePoint Soc...
.NET Framework 4 Appli...
.NET Framework Network...
.NET StockTrader Sampl...
Azure Troubleshooting,...
Building Windows Store...
AppFabric Caching
CAT.NET
Charts & Reports in th...
Direct3D 10
Chart Controls for .NE...
Feedback for Visual Ba...
Game Technologies: XNA...
LINQ to SQL (Pre-Release)
JScript for the .NET F...
Microsoft ESP Platform...
Microsoft Unified Comm...
Microsoft Unified Comm...
Office Development wit...
patterns & practices: ...
Performance Counters f...
Project Codename:  Jasper
Search Server: Frequen...
Software Transactional...
SQL Server 2014 Analys...
SQL Server 2014 Master...
Team Foundation Server...
Tellme Studio (retired)
UI Design for Windows ...
Visual Studio 2008 (Pr...
Visual Studio Database...
Visual Studio Team Sys...
Visual Studio UI Autom...
Visual Studio Online "...
Windows Live Data Deve...
Windows Presentation F...
Working with Data and ...
XML in Visual Studio 2...
Windows Phone Preview ...
Microsoft Partner Cent...
Cortana Skills Kit

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile