473,749 Members | 2,486 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using a Page variable in User Control

1 New Member
Hi,
I have a page with a private variable: AccountData.
This handles all of the account data and i save it in the viewstate between postbacks.
I have a User Control named - AccountFavorite s that renders all of the account Favorite topics.
When a user decides he wants to cancel one favorite topic he clicks on an asp:LinkButton and it postback to the server to change the value in the Database.

however, the Control doesn't know what "AccountDat a" is, only the page does. how can i use the "AccountDat a" in a postback of the Control? or can I make the postback go to the page instead?

Thanks a lot!
Apr 17 '14 #1
0 1259

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2633
by: Simon | last post by:
I have a form, "Form1" that I would normally step through using Control frm = FindControl("Form1"); foreach(Control ctrl in frm.Controls) But now I have this page as a user control loaded by a handler that has menu bars etc on. Form1 now resides on this handler page. How do I now use the same reference inside my user control to page through the controls on the form in the main page?
1
2958
by: Dan | last post by:
I have an asp.net page default.aspx with a user control and a placeholder control. <html> <body> <form id="myform" method="post" runat="server" /> <PageHeader:Header id="header1" runat="server" /> <asp:PlaceHolder ID="content" runat="server" /> </form> </body>
2
1619
by: Alex Wagner | last post by:
I've been trying to gain access to the container page from within a user control. Case in point: From within the user control I need to call a method in the business layer that needs a reference to the aspx page. The method signature looks like: public static void MyMethod(System.Web.UI.WebControls.WebControl MyWebControl, System.Web.UI.Page MyPage, string SomeOtherVariable) what am I supposed to pass in for the MyPage parameter??
10
1810
by: Mike Street | last post by:
I'm looking for the best way to make se of the function is a dll user control in an ASP.NET page. I've been unable to find anything specific to demonstrate how this can be achieved. Mike
2
1758
by: Raed Sawalha | last post by:
I have a aspx page with one user control , in the user control i have hidden field (name hdnSaved) runat server wrapped in property like following :- in documentview.ascx public string SaveClicked { get { return (hdnSaved == null) ? "" : hdnSaved.Text;
13
6229
by: Michael | last post by:
I have setup a public variable in the Master Page "code-behind-file". Now I would like to set that value from the UserControl, but I can't seem to find a way to do this. Does anyone have any ideas? I'm basically trying to set it up so that I can keep the User infor (userid, ect) in the Masterpage so that other pages can access it. Thanks for any ideas. Michael
3
1557
by: Mukesh | last post by:
Hi all I have to transfer a dataset and a string from a webform to a user control on the page without using viewstate or session or cookies . properties method is not working properly. if anybody thinks that is fine so plz describe me and send me any article or example for that. How can i do that
4
7596
by: Eric | last post by:
I got a particular problem in visual studio 2005 There's a user control on page and I want to meka a cast like this MyPage mp=(MyPage)this.Page; Error is : cannot cast from ASP.mypage_blalala_aspx to MyPage. Stupid namespace ASP doesn't have that class name. I can't even put any base classes to that crazy App_Code folder to get the class reference. Am I doing something wrong? All I want to do is during click to access a mainpage...
3
3619
by: HP | last post by:
hi there Is it possible to bind a datasource to a dropdownlist contained in a user control if datasource is positioned on the parent page of user control? I guess not, since user control doesn't appear when I'm selecting control parameters for datasource in a designer, right? But what's the alternative? Should I create custom parameter (like this: http://www.leftslipper.com/ShowFaq.aspx?FaqId=11) inside the user control class?
3
2854
by: remy.bur | last post by:
Hi, When adding an anchor (which is runat="server") in a user control, the link generated will be based on the user control location and not on the page which is using the control location. For example, if the user control is located in an include folder, here is what I will get: <a href="include/home.aspx"> instead of <a href="home.aspx">
0
8996
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8832
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9566
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9388
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9254
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8256
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6078
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4608
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2217
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.