Refresh Web form (parent) when submiting Web User Control

I got one Web form that contains one Web user control. The web form is displaying some data that is stored in database and Web User Control to edit this data and save the changes to database. When I press submit button in user control the data is getting stored in db, but Web form is not updated with this new changes ( i think this is because of the callback ). If I refresh the page then i see the changes. How can I make user control fire the refresh event in web form?

If you have a answer pls give me a example or point to one tutorial, its much easier to understand!

Thanks for your time!

0
TheGh0st
7/27/2006 3:37:25 PM
asp.net.web-forms 93655 articles. 6 followers. Follow

5 Replies
1033 Views

Similar Articles

[PageSpeed] 24

You have to rebind the controls after inserting new record and that should be done just after inserting new record.


Mihir Solanki
0
Mihir
7/27/2006 5:02:54 PM
Hello, thank you for you reply, but like I said I prefer a example or tutorial that show me how to do this. I have worked with .net in just few months. So pls, give me a example or something i can learn from. Thanks!
0
TheGh0st
7/27/2006 5:35:13 PM

By the way, the data that is displayed in the web form is not DataBind to database. I display the data in custom way..I will maybe need to access the Web Form Page and then call the method that displays the data, but the problem is that i cant get access to this page from the Web User Control. I know that I can get the parent page by writing

Page.Parent

but then I should cast it to the Web Form ( named Default3 ) like this

(Default3(Page.Parent)).displayDataMethod();

The problem is that Default3 is not known class in user control.

The Default3.aspx.cs file looks like this:

 

1    using System;
2    using System.Data;
3    using System.Configuration;
4    using System.Collections;
5    using System.Web;
6    using System.Web.Security;
7    using System.Web.UI;
8    using System.Web.UI.WebControls;
9    using System.Web.UI.WebControls.WebParts;
10   using System.Web.UI.HtmlControls;
11   
12   public partial class Default3 : System.Web.UI.Page
13   {
14   
15       protected void Default_Load(object sender, EventArgs e)
16       {
17       }
18   
19       public void displayData()
20       {
21       }
22   }

 

 

0
TheGh0st
7/27/2006 5:59:28 PM

Are there anyone who can help me with this problem? I really need this to get work soon and I have been searching for a answer on the google for 2 days now. I think I could solve this problem easy if i just knew how to get acces to "Default3" class in the web user control. How can i set the scope of this class to be on the entire solution, so every classes can access it?

0
TheGh0st
7/28/2006 6:29:55 AM

Finnaly!!!

I have solved the problem, bymyself! For those of you who are intereseted in how, you can read this tutorial:

http://www.odetocode.com/Articles/94.aspx

If you just change a bit the .cs files it will work perfectly. Do this to get it work with .net 2.0:

Delete lines:

protected WebUserControl1 BubbleControl;
protected System.Web.UI.WebControls.Button Button1;
protected System.Web.UI.WebControls.Panel Panel1;

and change body of the class from public class to public partial class

0
TheGh0st
7/28/2006 7:03:59 AM
Reply:

Similar Artilces:

Web Form and Web User Control
Hello, I have a Web User Control (ascx) that includes a button. This button has an onclick event method. This Web User control is included into a Web Form. (thru LoadControl). However, when I click on the button, the event method is not executed. What should I include in order it works fine? Thanks in advance. GAA. Using Loadcontrol is using dynamic controls and when using dynamic controls you must recreate the same dynamic controls ono postback to econstruct the page control tree. It is best if you do this during the Page PreInit event. How complex are your controls ...

Filling a textbox on a parent web user control from a child web form
Hi, I currently have a web user control (pf_imageselector.ascx) which is dynamically created (any number of times) on a parent web user control (pf_fillitems.ascx) which in turn has been loaded into a webform (default.aspx). On the user control is a text box called txbSelectedImage and a button. On click of the button run's this code: function OpenChild() { var strImageFile; var WinSettings = "height=580,width=630,status=yes,toolbar=no,menubar=no,location=no"; window.open("pf_stockimage.aspx", null, WinSettings); } Which obviously open a ch...

How to access a control on a web form from anoter web form
hi all I have this scenarios i have two web forms, one called form1 and the other called form2 form1 has a label with id "lbl1" is it possible to access lbl1 from form2, change its text permenantly? thanks.   refer: http://dotnetslackers.com/Community/blogs/haissam/archive/2007/11/26/ways-to-pass-data-between-webforms.aspxSSNPlease remember to click "Mark as Answer" on the post that helps you. MinaSamy: hi all I have this scenarios i have two web forms, one called form1 and the other called form2 form1 has a label with id "lbl1" is it p...

Web User Control Not rendering in Web Form
I have created a Web User control that is made up of a Multiview with 2 views inside the Multiview. I have buttons on both views and a gridview on 1 view. My question is when I drop this Web User Control on a Web Form all I see is [MultiView"MultiView1"] and when I view the from in the browser I dont see the Web User Control. I was wondering if someone could please tell me why the Web User Control is not displaying or rendering.     Thanks In Advance Hi, Please check your aspx file for correct reference, like following example: TestControl.ascx:<%@ Control ...

custom web user control and web form
Guys,          I am trying to develop a context menu control for all of my pages. what i am trying to do is that i want the control to pick a datasource from the markup and then check whether its an xml file or a datatable. I created a class called datasource.   /**************************DataSource Class****************************/  public class DataSource { /// <summary> /// This is to identify unique elements from the markup /// </summary>protected string _ID; /// <summary> /// This will be the Datasource ID e...

web web web
Name: bahadir Email: sensiz_olmuyor_t1_at_hotmail.com Product: Firefox 2 Beta 2 Summary: web web web Comments: web sayfası yapmak Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; tr; rv:1.8.1b2) Gecko/20060821 Firefox/2.0b2 ...

Can my web page with a form submit to other web pages forms?
I was wondering if I created an aspx page that had a form on it that I could use the submit button to submit this form's contents to other web pages forms(servers accepting those form's data). I am thinking this would be a great way to update data on particular web pages without having to actually visit those similar web pages. Any ideas, examples would be much appreciated. Thanks in advance.  Yes you can.  It's called Cross Page Posting: http://msdn2.microsoft.com/en-us/library/ms178139.aspxAlso: http://msdn2.microsoft.com/en-us/library/ms178140.aspx might ...

Submitting data from a know web form to unknown web form
hi i m making a software in which i will submitt some data from a web page that will go to a web form of which contrlos are unknown to me only i know the name and how many controls in that form it means i can see the form only. how can i do this please help me soon with code plz its very argent.i m doin this wit the help of foxtrot.xray.WebRobot but its giving me error that this dll file is already exists in The file ('C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\_foxtrot.xray.WebRobot.dll' already exists).i don know what will do so please help me soon please thanks praveen We ca...

How to Make Web Forms from other Web Forms
In putting together an ASP.NET application for a biz application, we have come to the point where there are three different types of basic forms which have, for the most part, been perfected. Now its is a matter of cloning those forms for various uses and modifying or adding code to suit the particular need. Copy and paste works OK, but there is a lot of changing of certain words, etc. Is there a way in ASP.NET to take these basic forms, turn them into classes or templates, create forms from them, then add or overwrite code? ? (Anybody who is a Vis Fox Pro programmer would know imme...

Web forms and mobile web forms
Hey everyone, I am looking to develope a web site that depending on the device connecting to it, it will display a certain page. In this case im looking to create a web and wap version of the same project. I have the Web forms version finished using ASP.NET and C# and I am wondering how to create the mobile web form and incorporate it in the project. In the project folder, can I just add a mobile web??? But what about displaying device specific pages?? Cheers -Dudach Yes, you can add mobile web forms and controls to your Web Application project. No problem. For device/br...

Pass data from Web User Control to Web Form
I have a Web Form that contains a Web User Control. The WUC displays dynamic content. I want to change the TITLE property of the Web Form, based on the contents of the WUC. For example, if the WUC displays information about Horses, I want to change the page title to "HORSES" by passing the string to the parent Web Form. I have tried playing with parameters and such, but I can't remember how I did this in the past. PLEASE HELP!~o0 Spin-Monkey Oo~ The best way to do this is by creating a public property on your web user control and accessing that from your web form. Check ...

validate Textbox in Web User Control from web form?
ASP.NET 2.0 I have a web user control that contains a textbox.  I need to add some validation (like requiredfieldvalidator, comparevalidator, etc). I would normally add the validator to my web user control by placing the validator next to my textbox.  However, I need the validation message somewhere else on my web form, not near the user control. So how would I associate a validation control on my web form with the text box inside my web user control?  Can this be done; any alternatives out there? Thanks!   The error message should occur wherever you place the vali...

Access a Web User Control Method from a Web Form
I'm trying to pass the Selected Index value from a web user control in a web form to the user controls selectedIndexchanged Sub.  I can't seem to figure out how to pass the information that I need to the user control and have it execute the sub routine. In the SelectedInedxChanged Sub I have a switch Statement and I want to get the index value from the web form where the user control is located and compare it to each case and then to have it execute the code for the case that it matches. What do I need to do? Hi, I am not sure if I understood your question correctly. I su...

Access SqlDataSource on Web Form from a Web User Control...
Hello, I want to access a SqlDataSource on a Web Form fromout. a Web User Control. To do this, I have in my code behind of the Web User Control the folowing code: DropDownList1.DataSource = (this.Page.FindControl("SqlDataSource3") as SqlDataSource);DropDownList1.DataTextField = "Name;DropDownList1.DataValueField = "NameIDropDownList1.DataBind(); But, the control (ic. SqlDataSource3) is not found. Even other controls like labels and buttons are not found with the FindControl. What am I doing wrong? Thanks Andromedaris     This is not much of a surprise,...

Web resources about - Refresh Web form (parent) when submiting Web User Control - asp.net.web-forms

Platform Updates: Operation Developer Love
... for request dialog on IOS not displaying Cancel button doesnt throw user denied exception fb login button doesn't show Error when submiting ...

Facebook Stack Overflow
Stack Exchange log in - careers - chat - meta - about - faq Questions Tags Users Badges Unanswered Ask Question Top Questions active 5 featured ...

Inspired Magazine (@inspiredmag) on Twitter
Sign in Sign up You are on Twitter Mobile because you are using an old version of Internet Explorer. Learn more here Inspired Magazine @ inspiredmag ...

Catalogue: State Library of WA & WA Health Libraries Network
... Actions section is where you have access to Your Account, and are able to interact with us here at the library. This section includes submiting ...

BC Parks 100 - BC Parks - Province of British Columbia
... BC Parks 100, we teamed up with British Columbia Magazine to offer an exciting contest at the Share Your B.C. adventure database. Submiting ...

Vidics.ch - Free Online Films - Watch Free Movies - Watch Films for free - Watch Series for free
Watch free movies online. Watch tvshows online free. Movie information. Actor information. Get all episodes and seasons of your TV Shows and ...

Join
In the form across you will see: * - this indicates compulsary items. (must be entered) - hover your mouse over the icon for more info. - ...

Biz Tips Blog: Online Marketing, Visibility and Business Blogging Tips
... turns your blog into an iPhone app and integrates your twitter feed and YouTube Channel if you wish. Then, MotherApp takes care of submiting ...

Penn & Teller Booking Agent - Book Penn & Teller Comedian For Corporate and Private Events Worldwide ...
... event, private party, fundraiser, college, fair or festival. Booking Penn & Teller comedian for stand-up comedy, speaking or events by submiting ...

Car2Be.com - Automotive Directory, Auto Resources & Automotive Info- Submit Link
The leading directory of auto with auto search engine was created to help the users in seeking the services and products, auto and company, and ...

Resources last updated: 1/22/2016 4:58:08 PM