Web Forms :: Detect A Pages !IsPostBack In Its User Control?

Aug 4, 2010

I have a page that uses a user control, I have to detect the pages !IsPostBack in the User Control and do some operation

In the User controls page Load method I tried using the following variations to detect the first load


None of these worked, they all fail to detect the parent pages 1st load in the usercontrols page load method

I also tried using

if (Request.UrlReferrer.AbsolutePath.ToString() != "/PreviosPage.aspx")

This worked for Fire Fox and Chrome but not IE (IE has issues with Request.UrlReferrer, it throws a null exception)

So I cant use this approach as well.

View 5 Replies

Similar Messages:

Web Forms :: Accessing A Public Property Of A Nested User Control In A Master Page From A Pages' User Control?

Sep 10, 2010

I've got a web site that has a master page and that master page (mpMaster that has a user control ucControl1) which has a sub user control (ucControl2), this user control has a property which accepts a value. Now, I have a page that uses the master page
and on this page I have another user control (ucPageControl), I need to find a way of setting the value in ucControl2 from ucPageControl. Is this possible at all?

View 5 Replies

Web Forms :: Sequence Order For Page.IsPostBack And User.Identity.IsAuthenticated?

Apr 22, 2010

What is the best sequence order for Page.IsPostBack and User.Identity.IsAuthenticated? From what I have search for, this comes up most common:

If Not Page.IsPostBack Then
If User.Identity.IsAuthenticated Then
~Some kind of code~
End If
End If

Is this considered "best practice" or can the two items - Page.IsPostBack and User.Identity.IsAuthenticated -be split into their own sections so the fuctions of these can be independent of each other?I am trying to troubleshoot a placeholder that disappears from a master page when a content page button is pressed to change the content pages active view (I have a multiview w/ 5 views inside of it).

View 2 Replies

Web Forms :: Can One Web User Control Gives Two Different Functionality On Two Different Web Pages

Feb 4, 2011

can one web user control gives two different functionality on two different web pages,suppose i use web user control on web form 1 and also web form 2 , but i want some more work from this control on web form1 but this more work not affect on web form 2. for example: button click event of web user control gives me Good Morning message on screen, when i use this control on web form 1 and web form 2 ,it will give me Good morning message on screen,when i click this button, But i want that ,this control give me Good Morning message and some other messages like good after noon on web form 1 only, one control but different functionalty on two different pages

View 2 Replies

MVC :: Strongly Typed User Control On All Pages Based On Login Status And User Role

May 9, 2010

I want to display a menu (which will be strongly typed with it's own unique model) across all pages only if a user is logged in.What menu items are available depend on the user's role and also I'll need to hit the repository to get numbers like "x Messages", etc

Been scratching my head for a simple solution here. Don't want to create something that need changes all over the place.All my controllers derive from a BaseController, all my Models from BaseViewModel....probably where I'll be implementing functionality for this.

View 3 Replies

Web Forms :: Avoid Reloading User Control Between Pages?

Jan 31, 2011

I have a user control which is used by several pages on my site. I would like the state of the controls within this user control to persist as I move from page to page, but presently any such page navigation causes the user control to reload from it's original state.

I have also noticed that this problem extends to the event handling methods of the controls on the user control. After executing the event handling method in the code behind file the page refreshes and the user control is reloaded from it's original state.

Is there a way to prevent this user control from reloading it's original state?

View 1 Replies

Web Forms :: Changing User Control Properties In Aspx Pages?

Feb 25, 2011

I have a simple user control(.ascx) with a asp label inside of it. Using the codebehind(C#) from a aspx page, how can I change the text of that label? I have tried using public classes in my user control and a few other things that I could think of off the top of my head. Can somebody give me a quick example of how this would be done?

View 4 Replies

Mobiles :: Detect IPhone / Access To Pages?

Apr 7, 2010

How can i detect if iPhone access to my pages?

For example default.page. When users use iphone to browse default page, it will redirect to iphone default page.

View 3 Replies

Web Forms :: Access Public Property Of User Control In Master Page On Child Pages?

Nov 29, 2010

How can one access public property of User Control In Master Page on child Pages.

View 1 Replies

Web Forms :: How To Detect The IP Position Of Website User

Sep 20, 2010

how to detect the IP position of my website user ?

View 12 Replies

Web Forms :: How To Detect Whether User Is Online Or Offline

Nov 25, 2013

I am working on a web project, and here i want to display a label which will display how many user is online and open this site. What can i do

View 1 Replies

Jquery - User Control PageLoad Function Not Fire On Some Of Pages?

Mar 10, 2011

I'm working on an ASP.net application.I had a problem with a user control I'd designed called LocationSelector. It worked great, but I couldn't use it within an ASP:UpdatePanel. I learned, by browsing SO, that I needed to put my in-line javascript in an external file and register it with ScriptManager so that there are no Response.Write calls in the Javascript.Next, I discovered that the control worked at first, but when I enclosed it within the ASP:UpdatePanel, it would stop functioning after the first AJAX postback. I read that to fix that, I needed to replace my $(document).ready call with function pageLoad() which is automatically executed with each ASP.net page load.

Several of my pages in my ASP.net application work fine (and I was really impressed with how well the framework seemed to drive the application). However, to my dismay, I discovered that my LocationSelector control no longer works at all on three of my pages. The HTML renders, but the pageLoad (which uses jQuery to bind events on control elements) does not fire.I verified this but putting alert('pageLoad'); as the first line of my pageLoad function. On the pages that work, I see the alert. On the pages that don't work, I never see the alert, even on the initial page load.What kind of problem could be causing the pageLoad function on my user control LocationSelector to execute on some pages, but not others?

View 1 Replies

AJAX :: How To Call Same Event Of User Control On Multiple Aspx.cs Pages

Jul 23, 2010

I have one user control which has 2 gridview first grid has columns (GroupName, Description, chkRemove checkbox) another gridview has columns (GroupName, Description, chkAdd), apart from that i dont have any code on .cs file of usercontrol.

I want to call same user control on 4 aspx pages and datagrid binding, sorting, paging and search functionality i want to do on respective aspx.cs pages not on user control where i am calling this uercontrol because for every aspx page field name is same but when i am binding the data to the grid that logic is different.

For first aspx page i called my usercontrol like this and everything is working fine: -


View 4 Replies

Web Forms :: How To Detect Which Control Caused A Postback

Dec 16, 2010

Is there a way to determine which control on a page caused a post back? I need to be able to make the determination since the _DataBound event of a FormView that I'm working with needs function differently based on which control caused the postback.

View 1 Replies

Web Forms :: Logic Behind IsPostBack

Aug 16, 2010

have gone through many post but unable to identify how IsPostback peroperty of page works.HTTP is a stateless protocol so how server identify that a client is making request 2nd time not 1st time and set the value for IsPostBack Peoprty.

View 2 Replies

Detect If User Is Authenticated With Active Directory?

May 21, 2010

We have a SSO solution with ADFS for logging into our web app, we also have standard setup that uses authentication with our database. I want to setup a solution that allows for both. So now I am trying to figure out, is there any way for ASP.NET to detect if a user is authenticated with Active Directory so I could do this on the fly? If user is logged in through AD, send through ADFS, else, show login screen. I also realize that this may not work if they are setup to use forms based authentication only after the ADFS process is started.

View 1 Replies

C# - How To Detect Inactive Time Of A User In A Website

Feb 28, 2010

This is my approach : I reserve last time that a user post a postback to server in a session and in every postback subtract this value from current value. Is there a better way for this?

View 1 Replies

Architecture :: How To Detect User Registration In Another Website

Mar 26, 2011

I reffer users from my website to another website (not my own website, I dont have any access to code).How can I detect a user registered in this website I have reffered to....

View 2 Replies

Web Forms :: Difference Between Ispostback And Iscallback?

Apr 16, 2010

the simple difference between Ispostback and Iscallback..

View 1 Replies

Using Javascript To Detect When User Has Selected Item In Listbox?

Mar 16, 2010

I am developing an ASP.NET web application that incorporates google maps. I have an ASP.NET listbox on my page which contains a list of items. When the user selects one of the items, I'd like to show this item on the map. The main complication lies in the fact that google maps uses javascript to control it and the listbox is a server control.

I can think of two ways to do this. The first would involve the listbox calling a javascript function when the user selects a new item. I can then write this function to perform the necessary map operations. Unfortunately, the OnSelectedIndexChanged property of the listbox doesn't seem to support javascript functions.

The second involves wrapping an UpdatePanel around the listbox and getting the listbox to perform a postback. In the SelectedIndexChanged event in VB/C#, I would the need to somehow make a call to a javascript function which would then update the map.

View 3 Replies

Security :: Detect Multiple User Logging Into The Same Domain In One Browser?

Jul 12, 2010

Two users using the same machine, same browser.

User 1 logs in the domain.
User 1 changes some data without saving it.
User 2 logs in the domain in a separate tab.
User 1 switches back to his tab and saves the data.
User 1 actually saved the data into User 2!!

This is caused by the following mechanism:

Different tabs in the same browser seems to share the same session id. We are storing user auth in cookie and the cookie is shared between tabs (same domain)

Therefore, when User 1 request to save, it is recognized as User 2 since the cookie has been updated to User 2.

So I'm wondering if there's any other methods to prevent this from happening, other than:

1. Use cookieless session so the session is embedded in uri.

2. Always include a hidden field in page to indicate which user owns the page.

View 1 Replies

Web Forms :: Dynamically Add Object In Page Causing Second Postback With Ispostback?.

Jan 17, 2011

I dynamically add the webcontrol in onInit or onload (page_load). it will cause the second post back and with the ispostback==false;

if first enter the page is no problem. but if I click on the some button. it will trigger postback two times.

first time: ispostback = true.

second time: ispostback = false.

the second time postback caused me headache because all my value has been initialized due to the coding like below:

DataTable _temp;

if(! ispostback)


View 2 Replies

Web Forms :: What Can Remove All Info From Viewstate And Making The Ispostback Again To False

Apr 23, 2010

I have a strange problem, my webform is loading twice.

when i debug i see ispostback is showing false for both times.

what happened to the first time load , and the viewstate.

What can remove all info from viewstate and making the ispostback again to false.

i am having real difficulty figuring out what is causing this problem.

View 3 Replies

Server Controls In User Control Are Null When User Control Serves As A Base User Control ?

Jun 4, 2010

I don't think I understand fully how ASP.NET does inheritance of controls.I have a user control, ucBase, which has an asp.net label in the ascx file. Code behind references the label and it works fine during run time if the control is not a parent for another user parent.

If I have another user control, ucChild, inheriting from ucBase, the label in ucBase's code is always null. ucChild has no controls in its ascx fileThe server controls (like the label) needs to be declared in the ascx file and not created programmatically.What needs to be done for ucBase to see its own controls when it's a parent user control?

View 1 Replies

Web Forms :: Assign User Control From Another User Control ? Giving Error Object Reference Is Not Set An Instance?

Feb 17, 2011

I am trying to assign user control from another user control ..first time its binding control successfully but when we refresh the data its giving error

saying "Object reference is not set an instance".

how to refresh data from another user control ...

My senerio below :

1 Aspx page

2. User control

calling usercontrol databinding method from aspx page but once it get refreshed ,not allowed to bind it again..

View 2 Replies

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