Latest developer linksBookmark and Share
 
HomeThis WeekTop MonthTop AlltimeSearchRegisterFAQ
  
 
Submit Your Link
Please login to submit your Link
 

How get clientID of a control in a ModalPopup of a User Control??

Posted: Dec/14/2010   By: nikhil   Points:15   Category: .NET  - ASP.Net    Views:183   Vote Up (0)   Vote Down (0)    

Hi,

I have a user control which has a modal popup. This modal popup has a grid and few controls like textboxes and comboboxes. I am trying to clear out all the controls when the close button is clicked. I am using javascript to close the modalpopup. but to clear the controls, $get('<%=txtbox1.clientID%>') method is returning null. can someone please help me?


Here is my code snippet.

function close_Click() {
    var mdlPopup1;
    mdlPopup1 = $find('modalPopup');
    mdlPopup1.add_hidden(clearInputFields);
    mdlPopup1.hide();
    
}

    function clearInputFields() {
        var name = $get('<%=txtName.clientID%>');

        name.value="";
       }

View Complete Post


Comments:
Be the first to comment this post.
 
Post Comment
Please login to post your comment
More Related Resources

Grouping Data in the ListView Control

  
In ASP.NET 1.X and ASP.NET 2.0 DataList was the primary control used to display data in groups. In ASP.NET 3.5 we have a new control that takes care of grouping data. In this article we are going to demonstrate how to group data using the ListView control.

Creating Charts with WebChart Control

  
Charts and graphs always attract more users to the website. Displaying statistical data in the form of graphs gives more meaning to the data. There are tons of third party controls that can be used to create impressive charts but almost all of them come with a price. In this article I will introduce a very simple charting control, WebChart which allows the developer to create really cool looking graphs with only few lines of code. The best thing about this control is that it is totally free. The article will focus on creating the SmoothLineChart and the PieChart.

Loading User Controls Dynamically

  
User Controls are great in ASP.NET. They let us divide the page into small sections. You can easily use User Controls on a ASP.NET page by simply dragging and dropping the control from the solution explorer. Sometimes we need to load the User Control dynamically. In this small article we will learn how to load the User Control dynamically.

PleaseWaitButton ASP.NET Server Control

  
An approach to displaying a "please wait" message/animated gif following a button click using encapsulated client-side JavaScript.

It is often useful upon a form submission in a web application to display a "please wait" message, or animated .gif image, particularly if the submission process lasts a few seconds or more. I recently developed a survey submission application in which internal users upload excel spreadsheets through a web page. The application inserts the uploaded data from the spreadsheets into a database. The upload/insert process may only take a few seconds, but even a few seconds on the web is a noticeable wait. When testing, some users clicked the upload button repeatedly; it was useful to provide a visual clue that the upload was underway. For that matter, it was useful to hide the upload button altogether, preventing multiple clicks. The control presented here, a subclass of the Button control, demonstrates how client-side JavaScript code encapsulated in an ASP.NET server control can provide such functionality conveniently.

Selecting Checkboxes inside the GridView Control

  
The ASP.NET GridView control is the successor to the ASP.NET DataGrid control which has many built in functionalities like paging, sorting, editing or deleting data. In this article I will explain how to select checkboxes inside the GridView control.

Introducing ASP.NET 2.0: GridView Control

  
In this article, you will learn how to work with the GridView control using the data from a Microsoft Access database. I will examine how to perform advanced tasks such as displaying, sorting, paging, updating and deleting data using one of the powerful controls included with Visual Studio 2005 in a step-by-step manner.

php user migrating to asp.net

  

Hi, I have a website that I need to add some dynamic data from asp.net, I'm completely new to .net and am having some problems (usually a php user).

K so, I have
a simple html tag
<a href="" title = "" >my link</a>

Now all I want to do is to insert some data in to the href and title parameters. in php I would just use <a href="<?php echo myHrefvar?>" title = "<?php echo myTitlevar?>" >my link</a>

I've tried doing
<a href="<% = myHrefvar%>" title = "<% = myTitlevar%>" >my link</a>

and in my default.aspx.cs I have the variables being set
string myHrefvar = "my href";
string myTitlevar = "my title";

but it always gives the message that they're not linked.

Have also tried
<a href="" title = "" ID=Req1>my link</a>

and in the apsx.cs file
Req1.HRef = "sdsdsd";
Req1.Title = "sdsdsd";

but again I get an error saying Req1 doesn't exist in the current context.

So help, I'm missing something rather fundamental here, any help would be much appreciated.

James


send alert message to user if close internet browser before save web form data

  

 Hi, I have window form to let user fill data, I want to alert user if close web browser before saved web form data, could anyone provide any clue?

 

Thanks,

Martin


How to display dynamic XML data inside a Panel control?

  

Hi all,

I have a SQL routine which builds me an entire XML file and returns it as a string. 
If I save the content of this file as sample.xml for instance, I am able to open it in IE or any other browser and the user can expand the nodes and see all the content he wishes.

I am trying to build a ASP.Net page which will display the content of a XML file in the same way (or similar) that the browsers do.

So far, I've been reading some posts and noticed I can use XmlDataSource control and its Data property to load the entire XML doc as a string. Now I am stuck how to display the contents. I found TreeView very confusing and not sure if DataGrid would be a alternative as well. I need to user to be able to open and expand the nodes.

Please someone point me to the right direction. What controls to use, etc... sample codes are the best ;-)

Thank you

 


the Wizard Control lose the value

  

Hello All,

I have a Wizard server control  to collect data and send it as an Email in the last step the problem i think that the page post back and clear the fields:


<asp:Wizard ID="WizardRG" runat="server" ActiveStepIndex="0" splaySideBar="False">
               
            <LayoutTemplate> 

             
                <div class="sidebar">
                  <asp:PlaceHolder ID="sideBarPlaceHolder" runat="server" />
                </div>
                
                
                <div class="step">
                  <asp:PlaceHolder ID="WizardStepPlaceHolder" runat="server" />
                </div>
               
                <div class="nav">
                  <asp:PlaceHolder ID="navigationPlaceHolder" runat="server" />
                </div>                
            
            </LayoutTemplate> 
            
            <SideBarTemplate>
                <asp:ListView ID="sideBarList" runat="server" >
                          <LayoutTemplate>
                            <div id="ItemPlaceHolder" runat="server"/>
                          </LayoutTemplate>

                          <ItemTemplate>
                           
                             <asp:Button ID="sideBarButton" CommandName="MovePrevious" Runat="server" Text="Button" UseSubmitBehavior="False"/>   
                             <%--<asp:LinkButton ID="sideBarButton" runat="server" Text="Button" />--%>
                           
                          </ItemTemplate>
                          <SelectedItemTemplate>
                                <%--<asp:LinkButton ID="sideBarButton" runat="server" Font-Bold="true" ForeColor="Yellow" Enabled="true" />--%>
                                <asp:Button ID="sideBarButton" CommandName="MovePrevious" Runat="server" Font-Bold="true" ForeColor="Yellow" Enabled="true" UseSubmitBehavior="False"/> 
                          </SelectedItemTemplate>
                          
                </asp:ListView>
            </SideBarTemplate>
            
            <StartNavigationTemplate>
                <p class="submitButton">
                    <asp:Button ID="StartNextButton" runat="server" CommandName="MoveNext" Text="Next" UseSubmitBehavior="False" />
                      
                </p>
            </StartNavigationTemplate>
            
            <StepNavigationTemplate>
                <p class="submitButton">
                    <asp:Button ID="StepPreviousButton" runat="server" CausesValidation="False" CommandName="MovePrevious" Text="Previous" UseSubmitBehavior="False"/>
                    <asp:Button ID="StepNextButton" runat="server" CommandName="MoveNext" Text="Next" UseSubmitBehavior="False"/>
                </p>
            </StepNavigationTemplate>
            
            <FinishNavigationTemplate>
                <div id="TableWrapper">
                        <p>
                            <asp:Label ID="LblemailTextBox" runat="server" Text="Please enter your email address if you would like a confirmation email:" AssociatedControlID="emailTextBox"></asp:Label>
                            <asp:TextBox ID="emailTextBox" CssClass="textEntry" Runat="server" AutoCompleteType="Email"></asp:TextBox>
                        </p>
                        <p class="submitButton">
                            <asp:Button ID="SendButton" runat="server" Text="Send" ValidationGroup="ContactUsUserValidationGroup" UseSubmitBehavior="False"/>
                            
                        </p>
                    </div>

                    <asp:Label ID="LBLMessage" runat="server" Text="Message Sent" CssClass="Attention" Visible="False" />
                    <p runat="server" id="MessageSentPara" visible="False">
                        Thank you for your message. We'll ge 
 
Categories:
.NET
Java
PHP
C/C++/VC++
HTML/XML
SAP
MainFrames
Data Warehousing
Testing
MySQL
SQL Server
Oracle
Javascript/VB Script
Others
Login
 
 
 
 
 Forgot password
 Contact Us   Terms Of use   Share your knowledge