Calling a method from a control page on the axpx page where the control page exists.
Hello,
I have an .aspx page that has a method called grdMain_DataBind(). I have a control page that loads within the aspx page which has its own logic. I have a button on my control page called "SAVE". How can I call the method grdMain_DataBind thats in my aspx logic from the control that exists on that page when I click SAVE button. Is there a way?
If I were you, I'd simply create a "Save" Event within your control. When the Button in your control is pressed, in the Click handler for that Button you can raise the event. Then, within t...
Call public method on aspx page from a web control embedded in the page
I have a nut to crack.
How do I call a public method on my aspx page from my web control, the web control is embedded into the page.
The markup looks like this:- 1 <asp:UpdatePanel ID="UpdatePanel1" runat="server">
2 <ContentTemplate>
3 <asp:Xml ID="Xml1" runat="server"></asp:Xml>
4 <uc2:tier3menu ID="menu1" runat="server" />
5 </ContentTemplate>
6 </asp:UpdatePanel>
I wrote an itemcommand thingie in the web control that needs to set the Documentsource a...
Call Server Side method from JavaScript function in Master Page
I have a JavaScript function in a Master Page. The function is below. function Add(q, p)
{
//call server side method
} I want to be able from within the JavaScript Add function defined above, call a C# server side method and pass the values q and p to it. No value is returned.I have tried PageMethods.CallServerSideMethod(q, p); but it will only work in a Page, not a master page.Is there any way I can do this in a master page?
How about using a web service call?Encosia - ASP.NET, AJAX, and more.Latest article: Using complex types to make calli...
Custom Control: Calling a function on calling page FROM a custom control ? help !!
I have a custom control placed on many pages, to make things simple, basically what I want to do is Call a function on the calling page from the custom control ieAnyone have any ideas, simple solution would be good !! This is the code I have myControl.ascx.vbPublic Partial Class myControl Inherits System.Web.UI.UserControl Protected Sub testButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles testButton.Click 'call save function on PersonalDetails.aspx.vb &...
Call a javascript function from a report, the function is in aspx page
Hi
How can I go about calling a javascript from from a report. The function is in teh code behind aspx page. When a user clicks a link on the report, this function needs to be called.
Further, the report sits in an iframe of the aspx page. So somehow I need access to the aspx page without opening any other pages.
I tried using this ="javascript:void SelectTab('tabScoreCard',EnergyExpert_" + Fields!EnergyExpertKey.Value.ToString() + "')"
but that gives me an error of no object found, when the user hits the link on the report to go back t...
Calling a function on a page from a control that is contained on the page
I have a page that contains several Web User Controls. Is it possible to call a function/subroutine on the page from inside one of the user controls?
TIA,Owen
yes you follow the following:
1- add new class call it BasePage which inhirits from System.Web.UI.Page.
2- let the code behind class for the page that will hold the control inhirits from this BasePage Class.
3-add the function you need to call in the BasePage Class.
4- in the control in the button click event for an example, you will use the following code to get the page which contains this control, cast it to t...
call method from aspx Page into ascx Page
Hi,I am having following code on Default.aspx which contains my User Control MenuTabs.ascxpublic void Test(){ //my working code} ******************************************************************************************************* My User Control Page MenuTabs.ascxprotected void imgmyrb_Click(object sender, ImageClickEventArgs e){ Here i want to call Test() method which is available in the Default.aspx } protected void imgmyskills_Click(object sender, ImageClickEventArgs e){ H...
Setting width for .net controls in code(.aspx) page using function call in code behind..
Hi,
Currently I am trying to set the width of the asp.net Table as follows.
<asp:Table width="<%=GetWidth()%>" >
and code behind
protected Unit GetWidth()
{
return Unit.Percentage(50);
}
It's not working. I know that it works if I set the width complete on some page event(like page_load) of code behind....
Is there a way to maintain the same syntax like calling code behind function in design page...i.e. calling function of .aspx.cs in .aspx page and assign the width as shown above.
Thanks and regards,
Giridhar...
Calling a server side method from javascript without page methods
Hi everyone.
I'm trying to do some like this:
if (confirm("foo") == true) {
MyServerSideFunction();
}
Of course, I can call this function using PageMethods, but since this function in my code behind shold be static, I cannot call others methods inside my class.
Is there any way to call serer side methods without using PageMethods?
Thanks, and sorry for my bad english!
You can use ajax to call a webservice from javascript. Check out this article on how to do it: http://www.semenoff.dk/en/Code-Corner/ASP.Net.AJAX/WebService-From-...
Call server-side page function from client-side button click
I have an existing ASP application that I am migrating to ASP.net. In the ASP app I was using the Microsoft.XMLHTTP on a the client-side of a ASP page to retrieve data from another asp page using the Microsoft.XMLDOM object. The client page passes 3 tags columns, table and Criteria. The receiving page builds the SQL statement executes the query and returns the row with all the column data. I am trying to convert it over to ASP.NET and I am getting errors on the xmlDOM.Load(Request.InputStream) on DLookup.aspx, the code is listed below.
Someone suggested to use System.Net HTTP classes su...
Can I call a method on aspx page thru the method of control(ascx)
Can I call a method on aspx page thru the method of control(ascx)Ajay Pathak MVP All About ASP.net
better u can createa method in class and access from ascxHAPPY CODINGhttp://shobhitrai.blogspot.com/
Your question is not clear to me, You mean to call method which is in aspx form ascx??Imran[MCTS]Few have audacity to speak truthhttp://knowledgebaseworld.blogspot.com/
Hi,
Please refer the following code,
uc.ascx:<%@ Control Language="C#" ClassName="uc" %>
<script runat="server">
protected void Page_Load(object sender, EventAr...
Calling a method written in .cs page from aspx page
Can we able to call a method coded in aspx.cs page from an asp control?This way:eg.aspx page----------<asp:TextBox ID="txtbox1" runat="server" OnTextChanged=<b>GetText()</b>></asp:TextBox>aspx.cs page------------public void GetText(){}
Yes. But the easiest way to set this up to ensure it works is to double-click the text box in Design View. That will automatically add the OnTextChanged event handler to the text box, and create the beginnings of the method for your code:<asp:TextBox ID="TextBox1" runat="server" OnTextChanged="...
How to call a javascript fn on page load of aspx page
hi ,
i m new to dot net can any one post the code tocall a javascript fn on page load of aspx page
You would do it in the same way as any other type of web page:<body onLoad="myfunction();"> Regards Mike [MVP - ASP/ASP.NET]My site
in ur page load
btnSumbit.Attributes.Add("onClick","Functionname(Param1,Param2.......)")
hope this helps
Saima Ghumman--Mark the post as Answer if the Post helps you--
Sam.Dev:in ur page load
btnSumbit.Attributes.Add("onClick","Functionname(Param1,Param2.......)")&nb...
Calling a javascript function in the content page from the master page.
I have an <asp:Menu on a master page and for one of the menuItems navigation url I can use 'javascript:myfunction()' to call a javascript function in the master page. No problem. Now, what I need to do is use that same master page <asp:menu menuItem to call a javascript function in the content page. Does anyone know how I can call a javascript function located in the content page from the master page using an <asp:Menu menuItem navigation url located on the master page?
Thanks,
Steve
HI
On the content page load u need to find the master page ...