Web Forms :: Javascript Function To Update Dropdownlist On The Form?

Feb 15, 2010

i have a multiline textbox on the form for the user to enter some description. On its OnTextChnaged event, i m using the text in the textbox and populate a dropdownlist with some values.

the textbox's html readd somthing like this

[Code]....

here ddlIndex is the dropdownlist to be populated.

i was wondering if i can use a javascript fucntion to do this?

i dont want the page to go back to the server to populate the ddlist, which does take a considerable time.

how to use a javascript function to achieve this functionality ..

View 6 Replies


Similar Messages:

Forms Data Controls :: Update Form Won't Post DropDownList Values

Apr 19, 2010

See what happens when you answer my questions! I come back! No good deed goes unpunished. I've built an Update form where my visitor can update data in dbase. I have a formview with several dropdown lists; none of which will update the table (all the textboxes, checkboxes and even Ajax enabled calendar work just fine). In the form below, visitor selects a CareerCluster from the ddl. Upon postback, the next ddl (pathwayListBox) populates with related data using the CareerCluster.selectedvalue in a query. At the same time, tsaOrgsDropDownList is also populated based upon the first ddl (CareerCluster).

When user selects from the tsaOrgsDropDownList the final ddl (tsaDropDownList) is populated. All this various selecting/populating works just fine on the form. The problem is: Nothing is updated to the table upon clicking the Update button. All other form fields do post as their supposed to except, I have other ddls on the page that are not related to the above series and they won't post either. My thought is that somehow, this is related to the postbacking going on. That posting back is overwriting the selectedValues with null or something.

<asp:FormView ID="courseUpdateFormView" runat="server" BackColor="White" BorderColor="White" BorderStyle="Ridge" BorderWidth="2px" CellPadding="3" CellSpacing="1" DataKeyNames="CTECourseID" DataSourceID="formviewSqlDataSource" Width="715px">
<FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
<RowStyle BackColor="#DEDFDE" ForeColor="Black" />
<EditItemTemplate>
<table align="center" width="700" border="1" cellpadding="10" cellspacing="2" bgcolor="White">
<%--A whole bunch of textboxes goes here--%>
<tr>
<td bgcolor="#dadada">
<strong>Number of HS Credits:</strong> <span>(Standards-based districts use the <em>Other</em> form field.)</span>
</td>
<td bgcolor="#FCCCCC">
<span><font color="red">Note: you must reselect HS Credits from the list or enter Other credits in the form field provided.</font></span><br />
<asp:DropDownList ID="numHSCreditsDropDownList" runat="server" TabIndex="3" ToolTip="Standards Based districts us the Other form field." ValidationGroup="HSCredits" AppendDataBoundItems="True" OnSelectedIndexChanged="numHSCreditsDropDownList_SelectedIndexChanged">
<asp:ListItem Selected="True" Value="0">--Choose One--</asp:ListItem>
<asp:ListItem>0.5</asp:ListItem>
<asp:ListItem>1.0</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td bgcolor="#dadada">
<strong>Career Cluster:</strong>
</td>
<td bgcolor="#FCCCCC">
<span><font color="red">Note: you must reselect Career Cluster from the list.</font></span><br />
<asp:DropDownList ID="careerCluster" runat="server" AutoPostBack="True" TabIndex="4">
<asp:ListItem Selected="True" Value="0">--Choose One--</asp:ListItem>
<asp:ListItem Value="1">Agriculture, Food & Natural Resources</asp:ListItem>
<asp:ListItem Value="2">Architecture & Construction</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td bgcolor="#dadada">
<strong>Pathways:</strong> <span>(Pathway as defined in the Cluster/Pathway model.)</span>
</td>
<td bgcolor="#FCCCCC">
<span><font color="red">Note: you must reselect Course Pathway from the list or enter Other Pathway in the form field provided.</font></span><br />
<asp:ListBox ID="pathwayListBox" runat="server" DataSourceID="CTECourses" DataTextField="ClusterPathway" DataValueField="ClusterPathway" SelectionMode="Multiple" Style="margin-left: 0px" TabIndex="5" Rows="3">
<asp:ListItem Selected="True" Value="0">--Choose One--</asp:ListItem>
</asp:ListBox>
<asp:SqlDataSource ID="CTECourses" runat="server" ConnectionString="<%$ ConnectionStrings:CareerTechEducationConnectionString %>" SelectCommand="SELECT [ClusterName], [ClusterPathwayID], [ClusterPathway], [ClusterCode] FROM [lkClustersPathways]
WHERE ([ClusterCode] = @ClusterCode)">
<SelectParameters>
<asp:ControlParameter ControlID="careerCluster" Name="ClusterCode" PropertyName="SelectedValue" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
</td>
</tr>
<tr>
<td align="center" bgcolor="#4A3C8C" colspan="2">
<asp:Label ID="occupationalStandardsLabel" runat="server" Font-Bold="True" ForeColor="White" Text="Occupational Standards"></asp:Label>
</td>
</tr>
<tr>
<td bgcolor="#dadada">
<strong>Source of Occupational Standards:</strong>
</td>
<td bgcolor="#FCCCCC">
<span><font color="red">Note: you must reselect Source of Occupational Standards from the list or enter Other Source of Occupational Standards in the form field provided.</font></span><br />
<asp:DropDownList ID="tsaOrgsDropDownList" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource3" DataTextField="TSAOrganization" DataValueField="TSAOrgID">
<asp:ListItem Selected="True">--Choose One--</asp:ListItem>
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:CareerTechEducationConnectionString %>" SelectCommand="SELECT [TSAOrgID], [TSAOrganization] FROM [lkTSAOrgs] WHERE ([TSAClusterID] = @TSAClusterID)">
<SelectParameters>
<asp:ControlParameter ControlID="careerCluster" Name="TSAClusterID" PropertyName="SelectedValue" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
</td>
</tr>
<%--A whole bunch of textboxes, checkboxes and other stuff goes here--%>
<tr>
<td bgcolor="#dadada">
<strong>What is the Summative Assessment (Technical Skills Assessment) for this course:?</strong>
</td>
<td bgcolor="#FCCCCC">
<span><font color="red">Note: you must reselect Summative Assessment from the list or enter Other Summative Assessment in the form field provided.</font></span><br />
<asp:DropDownList ID="tsaDropDownList" runat="server" AutoPostBack="false" DataSourceID="TSAs" DataTextField="TSA" DataValueField="TSAID" Width="300">
</asp:DropDownList>
<asp:SqlDataSource ID="TSAs" runat="server" ConnectionString="<%$ ConnectionStrings:CareerTechEducationConnectionString %>" SelectCommand="SELECT [TSAID], [TSA] FROM [lkTSAs] WHERE ([TSAOrgID] = @TSAOrgID)">
<SelectParameters>
<asp:ControlParameter ControlID="tsaOrgsDropDownList" Name="TSAOrgID" PropertyName="SelectedValue" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
</td>
</tr>
<%--A whole bunch of textboxes goes here--%>
<tr>
<td align="center" bgcolor="#dadada">
<asp:Button ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" Text="Update" />
<br />
<span><font color="maroon">* All fields except the Tech Prep Information are required.</font></span></div>
</td>
<td align="center" bgcolor="#dadada">
<asp:Button ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" />
</td>
</tr>
</tr>
</table>
</EditItemTemplate>
</asp:FormView>
<asp:SqlDataSource ID="formviewSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:CareerTechEducationConnectionString %>" SelectCommand="SELECT * FROM tblCTECourses WHERE (CTECourseID = @CTECourseID)" UpdateCommand="UPDATE tblCTECourses
SET HSCredits = @HSCredits, CareerCluster = @CareerCluster, Pathways = @Pathways, TSAOrgs = @TSAOrgs, TSA = @TSA, LastUpdate = GETDATE() WHERE (CTECourseID = @CTECourseID)">
<SelectParameters>
<asp:SessionParameter Name="CTECourseID" SessionField="CTECourseID" Type="Int32" />
</SelectParameters>
<UpdateParameters>
<asp:FormParameter FormField="numHSCreditsDropDownList" Name="HSCredits" Type="String" />
<asp:FormParameter FormField="HSCreditsOtherTextBox" Name="HSCreditsOther" Type="String" />
<asp:FormParameter FormField="careerCluster" Name="CareerCluster" Type="Int32" />
<asp:FormParameter FormField="pathwayListBox" Name="Pathways" Type="String" />
<asp:FormParameter FormField="tsaOrgsDropDownList" Name="TSAOrgs" Type="Int32" />
<asp:FormParameter FormField="tsaDropDownList" Name="TSA" Type="String" />
<asp:FormParameter FormField="TSAOtherTextBox" Name="TSAOther" Type="String" />
</UpdateParameters>
</asp:SqlDataSource>

In the codebehind I've tried to set selectedvalue to session variable upon selected index changed like this:

Protected Sub numHSCreditsDropDownList_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
Session("HSCredit") = DirectCast(courseUpdateFormView.FindControl("numHSCreditsDropDownList"), DropDownList).SelectedValue
End Sub

View 5 Replies

Web Forms :: How To Call JavaScript Function After UpdatePanel Update And Page Fully Load

Jul 27, 2012

My javascript that scroll down the page.

function SetScrollEvent() { window.scrollTo(0, document.body.scrollHeight);}

I update update panel from server side like below.

protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e){
//HiddenField hiddenId = e.Item.FindControl("hiddenId") as HiddenField;Label lb1 = e.Item.FindControl("Label2") as Label;
//Button bt = e.Item.FindControl("Button2") as Button;if (e.CommandName == "myclickevent"){
// your codes here...SqlConnection conn = new SqlConnection(constr);SqlCommand

[CODE] .....

I use repeater and repeater have button on button click i update the update panel. now where i have to call the javascript function so that it execute after update panel fully loaded. I want to call javascript function after page fully loaded.

View 1 Replies

Forms Data Controls :: Calling A Javascript Function In A Grid View Update Statement?

Mar 12, 2010

i need to know if this can be done :

i have a grid form with 3 fields field1 & field2 & field3.

in the insert statement the field 3 gets a javascript function result that uses filed1 & 2 values.

Now what i want in the grid view update statement is : to call the @field 1 & @field2 from the update statement to a similar javascript function..(do soem calculation ) and then re-assign the java function result to the @field3 variable in the update statement..

(//// Or simply what i want is to do the same calcultions onthe fields while perfoming an update operation.. //).

how can i perfom the calculations in a grid view update statament ..

View 3 Replies

AJAX :: Update Panel Stop JavaScript Function

Apr 15, 2010

The code which shown above where the problem is javascript have not function which the certain command trigger and involved for the outer javascript which called from the ajax's update panel web control.

How to allow the javascript can be run where it's call from inner update panel, for now its will cause the errors one the update panel's web control call the outside JS/countdown.js file as well....

View 1 Replies

C# - Force The JavaScript To Update The Page Before Running The C# Function?

Jan 7, 2010

I have the following code which should update a label to say "wait..", then run a function, and then update the label again to say it has completed:

<asp:Button ID="Button1" runat="server" Text="Upload"
onclientclick="document.getElementById('errorMessage').innerText='Wait...';"
onclick="Button1_Click" />

This works fine in IE, but not in Firefox.

When I run it in Firefox the label does not change until the process completes.

Is there a way to force the JavaScript to update the page before running the C# function?

View 5 Replies

AJAX :: Fire Javascript Function With Update Panel?

Oct 19, 2010

how to fire javascript function with update panel e.g is like i pur my registration code in update panel and after submit button click i.e filling all registration information i want to show message that ur successfully register(Javascript) may i know how to fire javascript

View 2 Replies

Web Forms :: Getting Error Calling Javascript Function From Another Javascript Function

Jan 3, 2011

Getting error calling Javsscript function from another Javascript function

[Code]....

View 4 Replies

Web Forms :: Serializing An Array From Code Behind Of One Web Form To JavaScript Of Another Web Form

Feb 16, 2011

I have a web form where I create an array of type structure.

In this form I have:

[code]....

but this is not OK.

View 1 Replies

Web Forms :: Redirecting An Array From One Web Form In The Javascript Section Of The Other Web Form

Feb 16, 2011

I have a web form where I define an array of type struct and I redirected it in the <script runat="server">
section of the second web form. But when I use that array below, in the <script type="text/javascript">
section in the html code of the same web form an error occured in the for cycle saying that the array (Array1) is undefined, and also the counter which I also defined in <script runat="server"> section.

I have this code in the <script runat="server">
section of the second web form:

public struct Point1
{
public float lat;
public float long1;
}
protected void Page_Load(object sender, EventArgs e)
{
//Retreive from session
Point1[] Array1 = Session["s1"] as Point1[];
//Run a Foreach loop
int nCnt
= 0;
foreach (Point1 p1
in Array1)
{
float x1
= p1.lat;
float y1
= p1.long1;
nCnt++;
}
}
and in the <script
type="text/javascript">
section I have:
var
for (var i = 0; i <
nCnt; i++)
{
lineString.getCoordinates().pushLatLngAlt(Array1[i][0], Array1[i][1],0);
}
lineString = ge.createLineString('');
lineStringPlacemark.setGeometry(lineString);

View 17 Replies

Forms Data Controls :: Update Dropdownlist With Detailview Control - Set Update Parameters?

May 10, 2010

I searched a lot of threads but still couldn't get my problem fixed. I have to update the "regform" table with two fields: session_ and session2. These two fields are inside the detailview edititem template which bounded to dropdown list drpsession1, drpsession2 separately. I wanted to pass the update parameters to the update sql UPDATE dbo.regform SET session_=@session_, session2=@session2 where id=@id

the @session_ is bounded to a drpsession1 and @session2 is bounded to drpsession2. I used
ControlID="ctl00$ContentPlaceHolder1$DetailsView1$drpsession1" to access the dropdown list within the detailview, but still couldn't do the updates. What's wrong with my code? Do I have to use the code behind to specify the update parameters? and How to do it? TIA.

<
"
asp:DetailsView
ID="DetailsView1"
runat="server"
AutoGenerateRows="False"
DataSourceID="SqlDataSource2"
Height="50px"
Width="544px"
DataKeyNames="id"
ondatabound="DetailsView1_DataBound">
<Fields>
<
asp:TemplateField
HeaderText="Session -Part I"
SortExpression="session_">
<
EditItemTemplate>
<asp:DropDownList
ID="drpsession1"
runat="server"
DataSourceID="SqlDataSource3"
DataTextField="session_time"
DataValueField="session_id"
SelectedValue='<%# Bind("session_") %>'
AppendDataBoundItems="True"
Width="229px">
<asp:ListItem
Text="Please select"
Value="-1"
/>
</asp:DropDownList>
<asp:SqlDataSource
ID="SqlDataSource3"
runat="server"
ConnectionString="<%&#36; ConnectionStrings:Connstr %>"
SelectCommand="SELECT dbo.sessions.* FROM dbo.sessions"></asp:SqlDataSource>
</EditItemTemplate>
<
asp:TemplateField
HeaderText="Session - Part II"
SortExpression="session2">
<EditItemTemplate>
<asp:DropDownList
ID="drpsession2"
runat="server"
DataSourceID="SqlDataSource4"
DataTextField="session_time"
DataValueField="session_id"
SelectedValue='<%# Bind("session2") %>'
AppendDataBoundItems="True"
Width="234px">
<asp:ListItem
Text="Please select"
Value="-1"
/>
</asp:DropDownList>
<asp:SqlDataSource
ID="SqlDataSource4"
runat="server"
ConnectionString="<%&#36; ConnectionStrings:Connstr %>"
SelectCommand="SELECT dbo.sessions2.* FROM dbo.sessions2">
</asp:SqlDataSource>
</EditItemTemplate>
</Fields>
</asp:DetailsView>
<
asp:SqlDataSource
ID="SqlDataSource2"
runat="server"
ConnectionString="<%&#36; ConnectionStrings:Connstr %>"
UpdateCommand
where regform.id=@id">
="UPDATE dbo.regform SET session_=@session_, session2=@session2 where id=@id">
<UpdateParameters>
<asp:ControlParameter
ControlID="ctl00$ContentPlaceHolder1$DetailsView1$drpsession1"
Name="session_"
PropertyName="SelectedValue"
Type="String"
/>
<asp:ControlParameter
ControlID="ctl00$ContentPlaceHolder1$DetailsView1$drpsession2"
Name="session2"
PropertyName="SelectedValue"
Type="String"
/>
<asp:ControlParameter
ControlID="DetailsView1"
Name="id"
PropertyName="SelectedValue"
/>
</UpdateParameters>
</asp:SqlDataSource>

View 2 Replies

Call Javascript Function And Server Side Function From Linkbutton

Jan 27, 2010

<asp:LinkButton CssClass="button" ID="btnApply" runat="server" OnClick="btnApply_Click()" OnClientClick="Apply1('btnApply')" >
hi ihave this functin in .vb file
Protected Sub btnApply_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnApply.Click
end sub

and javascript function also in aspx

function ApplySummerization(id)
{
alert("hai");
}

View 4 Replies

AJAX :: Using A User Control's UpdatePanel.Update() From A Page-level Update Panel's Function Call?

Jul 14, 2010

I've exempted the irrelevant bits of code. Essentially, I am trying to change the URL of an image control inside of an update panel inside of a custom user control from a function called inside an update panel from my main page. Using UpdatePanel.Update() isn't working: I end up waiting for the next full page POST to occur before all the updates I make to CustomControl from buttons within the main page's update panel are visible. I verified that Update() was being called via the debugger: there are no issues in that department.

Here, you can see Custom Control and the Button declared. The button is in an update panel to avoid giving a full POST and causing the whole page to reload.

<cust:CustomControl runat="server" ID="CustomControl1">
<asp:UpdatePanel runat="server" ID="UpdatePanel1"> <ContentTemplate>
<asp:Button id="Button1" runat="server" OnClick="DoStuff" />
</ContentTemplate> </asp:UpdatePanel>

This control stores images within their own seperate update panels because rerendering the images is very slow (it requires processing arrays of millions of datapoints) and the user only ever needs to modify one image at a time. I'm using Image1 as an example.

[Code]....

View 3 Replies

How To Replace A Function Name Using JavaScript And Have It Be Recognized As A Function

Aug 25, 2010

I am trying to replace the JavaScript onclick event handler in ASP.NET that is added to a button control when using validation controls. This is what is output into the HTML from ASP.NET in this scenario:

<input type="image" name="ibSubmit1" id="ibSubmit1" src="button-green-submit.gif" onclick="showProgress1();WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ibSubmit1", "", true, "Group1", "", false, false))" style="border-width:0px;" />

I have looked pretty estensively, and unfortunately there doesn't seem to be a way to modify the function server side before it is injected into the page.

Since I am developing a control and desire it to be non-invasive and self contained, and I am interested in obtaining the validationGroup parameter of the WebForm_PostBackOptions object, it seems that the easiest solution would be to use JavaScript to replace the WebForm_DoPostBackWithOptions function name with my custom wrapper function and leave all of the rest of the parameter information intact - then I can extract the information I am interested in, call my custom functions, and then forward the call on to WebForm_DoPostBackWithOptions.

NOTE: I am using jQuery to build my custom function, so if there is an easier way to do this with jQuery it is an option I will consider.

Here is the code I tried to replace the onclick event handler (not working):

$('[onclick*=WebForm_DoPostBackWithOptions]').each(function() {
var txt = this.onclick;
txt = txt + '';
txt = txt.replace('WebForm_DoPostBackWithOptions','ml_DoPostBackWithOptions');
this.onclick = eval(txt);
});

Using alert(), I verified that the text is being changed correctly, however whether or not I use the eval() function, the onclick handler doesn't seem to recognize it as JavaScript.

I thought of using a regular expression to get the validationGroup value, but this seems like it will be far more elegant and flexible if I can get it working...

Note: If there is a way for my control to interrogate the page it is on to find all of the buttons that will post back (regardless of what type of buttons they are) so I can retrieve the property server-side, this is also something I will consider.

View 3 Replies

Web Forms :: Asp:DropDownList Function Not Being Called?

Dec 8, 2010

I have a dropdownlist on a web form that isn't calling a routine when I click on a new item in the dropdown.Here's my code from the .aspx file

[Code]....
[Code]....

My list is populated with a blank item as the 1st entry and then all the alerts that I have in my database. I originally had OnSelectedIndexChanged but that didn't work either.

View 4 Replies

Call Codebehind If Javascript Doesn't Exist In Browser - Else Javascript Function

Sep 29, 2010

In asp.net page, How can i call the javascript methods for form processing-submitting if the user browser supports javascript and use code behind events if the browser does not support javascript.I have the javascript code to send the form data to an ajax server page using jquery. Don't know how to invoke the needed one based on the browsers javascript availability

View 1 Replies

JavaScript - User Control JavaScript Function Doesn't Run

Sep 22, 2010

I have the function put here like below:

$(document).ready(function () {
UserControlNameInit();
});

The script are put in the following and the block is in the .ascx page.

<script type="text/javascript">
</script>

However, the function UserControlNameInit() does not run when the page loads. It is showing in the page source. I can still call this function through FireBug console by manually typing the name of the function.

I did the same way with other user controls, and it works. Just 1-3 user controls are not working...

View 1 Replies

Forms Data Controls :: Search Function With DropDownList And Textbox?

Jun 28, 2010

I have a table called "publication" which contains records about Sharkspeare's plays, there are columns called "type", "nortonoxfordnumber", "nortonoxfordtext" and "character". What I like to achieve is to allow users to search the data using both dropdownlist and the textbox. i.e., the listitems of the dropdownlist are Othello, Tempest and twelfth night. Users should be able to type a keyword such as "music" to search within the particular play say "Othello" from the dropdownlist.

I would like to add button click function, and I know that I need to use the query with "and" and LIKE, but I am not sure how to do it as I keep getting the syntext error.

I managed to get some code done, however, I only managed to be able to search one column at the time, here is my code:

[Code]....

View 9 Replies

Forms Data Controls :: Put The Call For The Update Function?

Apr 13, 2010

I have GridView with my own Edit/Update functionality.

What is the best place to put the call for the update function?

I know that placing the Update button will have the click event.

I have extra textboxes and other controls placed on the edit-mode that will have me to find them. So, what is the best place to put the call for the update function that will let me find these controls to be updated?

Is it via GridView_RowCommand and the use of CommandName ?

[Code]....

View 3 Replies

Web Forms :: Return Value From Javascript Function To C#?

Jan 20, 2010

I call the javascript function in cs using button.attributes.add("onclick","function();");

how can i return a val to cs's string variable from js?

View 2 Replies

Forms Data Controls :: GridView Edit Update Function?

Oct 11, 2010

I have a gridview and am using the Edit - Update function to update one field in my gridview. I have the textbox appearing as I want it and am able to update the data for that cell.

The problem I have is refreshing the gridview after the update. The Update and cancel are still shown instead of the gridview refreshing back to the Edit statement after the update.

View 4 Replies

Web Forms :: How To Prevent Function() In JavaScript To Execute

Mar 31, 2010

I only want to execute this JavaScript function runEx() if publicVarFromCodeBehind != "abc".

I am setting the publicVarFromCodeBehind = "abc" in the Page_Load event but anyway the runEx() function is executing. I wonder how this works and how to prevent runEx() from executing though I need to catch the logic from C# and pass on the variable to the JavaScript.

[Code]....

View 4 Replies

Web Forms :: Call A JavaScript Function From Server

Jan 7, 2011

I have a web form that has a button. The click event of the button submits the form for processing on the server. On the server, after the processing is complete, I want to call a JavaScript function. I don't want to attach it to a control. Just call it.

View 7 Replies

Web Forms :: Return Value From Javascript Function To C# Code Behind

Sep 28, 2010

I want to send value from text on text keypress event in C# Code Behind Function. or get value from server side script function which called on textbox keypress event to C# Code Behind Function. How i do that

View 2 Replies

Web Forms :: Running Javascript Function Before Code Behind

Oct 15, 2010

I need to run a javascript function before my code behind runs. my element looks like :

<asp:Button ID="SuperaddsSMSPnl_Button1" runat="server" Text="Smsa" CommandName="smsa"
CommandArgument='<%#Eval("addsid") %>' CssClass="knapp" Style="left: 180px; top: 20px;" />

and in code behind I use

Dim smsbtn As Button = it1.FindControl("SuperaddsSMSPnl_Button1")
smsbtn.Attributes.Add("onclick", "showSign(this); return true;")

to show in progress sign while code behind is doing its job. but I want code behind to run by using commandName

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved