Web Forms :: Which Is The Method Providing The Web Page Calling Another Web Page

Feb 3, 2010

let us say 'default.htm' (.aspx is not possible due to whatever reason) is "calling" 'start.aspx' as following:

<a href="start.aspx"></a>

now i would like to have a method in 'start.aspx' letting me know, from which page 'start.aspx' had been "called" (in my sample this would be 'default.htm'). what would the c#-code look like?

View 9 Replies


Similar Messages:

Web Forms :: Calling Javascript Method During Page Load From Content While Using Master Page

Mar 30, 2010

I want to call a javascript method during page load. I am using application.master of the sharepoint server 2007 as the master page . In the content page i want to call a custom method named OnLoadFun() during loading the content page. I have written the function inside script tag in the PlaceHolderAdditionalPageHead id section of the content page.

[Code]....

How do i call the OnLoadFun method so the i is being called onload time. i tried putting window.onload=OnLoadFun surrounded by script tag within the PlaceHolderMain content section.

View 1 Replies

Web Forms :: Finding The Calling Page Of A Class Method?

Jul 27, 2010

I have the following method in a class withing a website.

public static void Authorise(int role, Page callingPage)
{
callingPage.Master.FindControl("divUnauthorised").Visible = true;
callingPage.Master.FindControl("ContentPlaceHolder2").Visible = false;
}

Now this works fine but I really want to just have the one parameter of role and not require the page to pass itself into the method. Is there a way of finding the object that called the method and casting it to a System.Web.UI.Page?

View 2 Replies

Web Forms :: Calling Master Page Method From A User Control?

Apr 5, 2010

Does anyone know how I would go about calling a method found in the master page code behind from a user control's code? The user control is on the master page. The method I want to call is public.

I can easily call a method found in the pages code behind using:

Page.GetType().InvokeMember("TheMethodsName", System.Reflection.BindingFlags.InvokeMethod, null, this.Page, null);

or I can call a method found on the master page from my aspx page code behind using:

((MasterPage_MasterPage)Page.Master).TheMethodsName();

But I am stuck because I can't find the MasterPage in my user control code behind.

View 4 Replies

Web Forms :: Calling A Page Method Using InvokeMethod From An User Control?

Jan 18, 2011

I have an aspx page which has an usercontrol say UC1 for selecting query paramters.

UserControl uc1 in turn opens another user control (UC2) as a modal popup.

1. On OK click, I am setting the values of another usercontrol (uc1) from the control uc2 by invoking a page method(doAccept). It appears to call the method and values seems to be set. But the problem the usercontrol/page does not display the new value or in otherwords it is not refreshed.

If the above is not possible is there any other way to refresh the parent page.

[Code]....

View 3 Replies

Web Forms :: Calling A Public Method On Aspx Page From A Usercontrol

Sep 7, 2010

I have a problem with calling a method on a aspx page from a usercontrol.

The case is: I have 1 main page with 5 usercontrols, when something goes wrong in the code I want to display the error message in a Modalpopup Extender. I can create for each usercontrol a different modalpopup extender but isn't much easier when I make 1 popup in the aspx page. But the problem is: How should I call a method in the aspx page that open the popup?

I have search several hours on the internet but can't find anything useful.

View 2 Replies

C# - Calling Method On Master Page From WebMethod

Aug 4, 2010

, imagine a Master page that implements IFooMaster with a method

ShowFancyMessagePopupTheBusinessCantLiveWithout(string message);

I am in a page that inherits this master page. Upon a checkbox being unchecekd, I want to show a message to the user that if they save it, they can't re-check the checkbox without some admin action.

I've been given feedback that I can't just use an alert('message'); in javascript because they want the consistent look of these messages.

Next, I tried to make an ajax call via PageMethods (as that's what everything else in this codebase uses) to show a message. My problem lies in this method being static.

[WebMethod]
public static void ShowSuperImportantMessage()
{
if(!checkboxICareAbout.Checked)
((IFooMaster)Master).ShowFancyMessagePopupTheBusinessCantLiveWithout("If you uncheck that thing, you can't recheck it.");
}

Since ShowSuperImportantMessage() is static, I can't access Master from within. The method on the master page looks more or less like this:

public void ShowFancyMessagePopupTheBusinessCantLiveWithout(string message)
{
lblGenericMessage.Text = message;
btnGenericMessageOK.Focus();
upGenericMessage.Update();
mpeGenericMessage.Show();
}
mpeGenericMessage is an ajaxtoolkit:ModalPopupExtender.

upGenericMessage is an update panel.The other 2 are obvious.

Can I do some jQuery kung-fu to show that stuff? I tried, but the solution complained that the controls I tried to refer to by ClientID didn't resolve since they were on the Master page.

quick edit: Before anyone tells me the architecture is a problem, or I shouldn't have put such a thing on a master page, or w/e...

I know the situation is not ideal, but I this is inherited code, and I can't drop it all and rewrite half of their web stack.

View 3 Replies

C# - Calling A Codebehind Method From Aspx Page From Gridview?

Nov 23, 2010

How do you call a codebehind/class method from a gridview in an aspx page? Also, I need to pass the value of databound column to that method. Is this possible?

Something like this:

<asp:BoundField DataField="Precision" />
<asp:BoundField DataField="MyNumber" DataFormatString="FormatHelper.Format(MyNumber, Precision)" />

View 3 Replies

Security :: Calling The LoginControl From Another Page Or A Webservice Method

Jul 19, 2010

I am using the Login Control and the Login.aspx page for Login authentication. How can I call login from another page or a webservice method with a Userid and password parameters.

[Code]....

View 3 Replies

C# - Calling A Method On The Parent Page From A User Control?

May 3, 2010

I am using a user control that I created (just a .cs file not an .ascx file), that does some magic and depending on a value generated by the control, I need it to do something on the parent page that is 'hosting' the control. It needs to call a method under certain circumstances (method is on the parent control).the control is placed on the parent page like so:

<customtag:MyControl ID="something" runat="server" />

I'm dynamically creating buttons etc on the control itself but when a button is clicked, let's say for example that there's a text box on the control and if the value of the textbox is "bob" it needs to call a method on the page that's housing the control...how can I accomplish this?

View 3 Replies

AJAX :: Calling Parent Page Method From User Control?

Oct 3, 2010

I looked up the threads about this. But I couldn't do it...

this is my method in aspx.page:

public void MesajlariGetir()
{
DataSet ds = new DataSet();
SqlConnection con = new SqlConnection();
SqlCommand cmd = new SqlCommand("msjlarigetir", con);

[Code]....

View 4 Replies

AJAX :: Trying To Enable Rest Of The Panes By Calling The Function ShowPanes In The Main Page By Using Invoker Method?

Sep 28, 2010

In the content page, I have an ajax accordion pane with couple of panes. Within each of those panes there is 1 user control. Initially all the panes except the first one (AccordionPaneMain) is enabled. The first pane user control contains a form view . In formview itemcommand I am doing some processing and then was trying to enable rest of the panes by calling the function showPanes in the main page by using invoker method. My problem is, the method (showPanes) is getting executed but the panes are not enabled.

Sections of code below

[Code]....

View 7 Replies

C# - Validating Textbox Content On Blur By Calling Server - Side Method Without Affecting Page Behaviour

Oct 21, 2010

I have a textbox in one grid-view column where upon entering a particular value and losing focus of the textbox, should post to the server to get the text validated through a server-side method. If the entry is valid, a result set to fill rest of row cells would be returned, else the bgcolor of the textbox needs to be changed to Red.

I tried posting back through the obvious way, i.e. making the textbox's autopostback as true and wiring up a server-side OnTextChanged event handler to validate the entered value.

It is working with this setup, but is also affecting the remaining page controls behaviour. For example, if I click a button in some other grid after entering some text in the textbox, the OnTextChanged handler gets called thus preventing the button's click event, which I also wish to call to execute its functionality.

View 2 Replies

Web Forms :: Providing Vertical Scrolling To Page In Postback Event?

Feb 27, 2010

I am using gridview in my aspx page. In that i have placed questions and related link button with text viewAnswer.Bellow that gridview i have olaced a lable . When i click on viewanswer the answer apear on lable. but here i want that the user can view lable at first sight. for that how can i provide dynamic verticle scroll to my page target as lable..

View 1 Replies

Web Forms :: Calling A Page And Getting The Result In The Calling Page?

Jan 3, 2011

I've a question I don't know if this is possible or not. I've tried a lot of things till now but could not accomplish on what I wanted to do.

What I want to do is call a web page from another page and some how execute either the page load event or page init event and get the result of the page in the first page.

Page A calls page B. Page B has static text and a label which is being set in page load event.

Page B - Code behind

[Code]....

Page B -- HTML code

[Code]....

Till now what I've tried is using the code below from page A. But this code just returns the Html code and nothing else.

[Code]....

View 3 Replies

JQuery $.get Refreshing Page Instead Of Providing Data?

Jan 19, 2010

I have written some code using jQuery to use Ajax to get data from another WebForm, and it works fine. I'm copying the code to another project, but it won't work properly. When a class member is clicked, it will give me the ProductID that I have concatenated onto the input ID, but it never alerts the data from the $.get. The test page (/Products/Ajax/Default.aspx) that I have set up simply returns the text "TESTING...". I installed Web Development Helper in IE, and it shows that the request is getting to the test page and that the status is 200 with my correct return text. However, jQuery refreshes my calling page before it will ever show me the data that I'm asking for. Below are the code snippets from my page.Please let me know if there are other code blocks that you need to see.

<script type="text/javascript">
$(document).ready(function() {
$(".addtocart_a").click(function() {

[code]...

View 1 Replies

JQuery-AJAX Calling Page Method / How To Return Value Back To JQuery

Jan 31, 2011

If I use jQuery AJAX to call a specific ASP.NET page method how to have that method return a value back to the AJAX method that called it?

Update

My situation is I have an existing web application with many existing methods. I would like to be able to use jQuery to execute some of these methods and then update the UI with the results. My mandate is to stay away from ASP.NET AJAX and stick with jQuery. Management is concerned about continued development and support with ASP.NET AJAX from Microsoft. I agree with them.

View 3 Replies

AJAX :: 401 Unauthorized Error In App, AJAX Control Calling Web Method Within Same Page

Jan 10, 2010

I'm using a custom AJAX based validation control to check user name availability from database. It's working alright in my development machine but in production server we are using Windows Authentication to authenticate by domain.The control is inherited from base validator and checks for user name availability from database perfectly but on form submission at Page.IsValid check it gives the following error.

remote server returned an error 401 unauthorized

Both the form and webmethod are in the same page/file. I even tried creating webmethod in a separate standalone webservice but error still there.

View 2 Replies

Web Forms :: Calling Page In Div - The State Information Is Invalid For This Page And Might Be Corrupted

Aug 5, 2013

I am using Jquery Load and calling a page in a div.

Now while doing postback m getting this errorĀ The state information is invalid for this page and might be corrupted.

SO what might be the possible solution for the same.or is this error due to some other thing.

All this error am getting while doing postback.and when i refresh the page and do the same thing again it works absolutely fine.

View 1 Replies

Web Forms :: Calling A Function On Master Page From A Content Page?

Jun 26, 2010

i have this function on my master page, i want to call it from one of my content page, what should i do?

function showAddress() {
var txtAddress = document.getElementById('txtAddress');
var address = txtAddress.value;
geocoder.getLatLng(
address,
function (point) {
if (!point) {
alert(address + " not found");
}
else {
map.setCenter(point, 15);
var marker = new GMarker(point);
map.addOverlay(marker);
marker.openInfoWindow(address);
}
}
);

View 5 Replies

C# - How To Open A Sharepoint Page By Providing The User Credentials Silently

Jan 14, 2011

I want to open a native SharePoint 2010 page from my application (for example the Edit Properties page of a document) without the need to enter username/password, but instead to authenticate silently (prior or during the page request). is that possible?In other words, i have a windows forms application, i enter a sharepoint document path and i click on a button, this will open up a windows form with a browser control that will navigate to the native "editform.aspx" sharepoint 2010 page for this document.

View 2 Replies

Architecture :: Providing Users With Unique Home Page Like In Facebook?

Oct 29, 2010

I am trying to provide each user with his/her own link to my website link we have in facebook e.g www.facebook.com/user_name.

How can we do this.

View 2 Replies

Visual Studio :: Providing Linenumbers In Aspx Or Codebehind Page?

May 7, 2010

how can I ensure linenumbers in aspx or vb page when opened in visual studio

View 2 Replies

Javascript - How To Pass Page Or Master Page Object To AJAX Page Method

Oct 5, 2010

I wrote a page Page method in my aspx page. in web service method I need to call FindControl method return textbox and get text box value. But my findControl will take MasterPage object to iterate.

code.<script type = "text/javascript">
function ShowCurrentDateTime() {
$.ajax({ [code]....

But I am getting compiler error when use Page.Master: Reference to non-shared member requires an object reference

How to pass Master Page object or Page to Page method?. So I can use in Sared method.Is there any way I can access Textbox value directly in Page method? I need access couple of controls in Page Method.

View 4 Replies

Web Forms :: Access Master Page Method In Child Or Content Page

Feb 13, 2014

I created one method in master page, I want to use that method in some other page(Child or Content page).I tried this method but No luck, it's not working in Master Page:

public partial class TestMaster : System.Web.UI.MasterPage
{
public void XXXX()
{
}
}

I'm trying to call this method in child page like

TestMaster MyMasterPage = (TestMaster )this.Master;
MyMasterPage.

View 1 Replies







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