CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.web_parts_and_personalization Tags:
Item Type: NewsGroup Date Entered: 1/16/2008 1:26:12 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 1 Views: 68 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
2 Items, 1 Pages 1 |< << Go >> >|
stelianx
Asp.Net User
WEB PARTS, CalendarExtender, UpdatePanel reset textbox values1/16/2008 1:26:12 PM

0/0

Hello

I have a web part on which are 2 calendar controls. This web part is actually a user control. In that user control i have 2 txtBox es and 2 calendarExtenders(1 at 1). In the page_load of the UC i have something like:

 if(this.Page.IsPostBack){

this.InitUI();
}

in the InitUI() we initialize both textBox es values.

In the debug mode InitUI is called only once (when the page is first loaded). If I change any textBoxText by using the calendar extenders , after postback, even the InitUI() is not called again, the textbox fields are reset every time to the default values


Yours,
Popa D. Stelian
MCP/MCAD/MCSD
ROMANIA
stelianx
Asp.Net User
Re: WEB PARTS, CalendarExtender, UpdatePanel reset textbox values1/16/2008 2:54:28 PM

0/0

More info about this.

In the master page i havebthe code:

Control wpCtl = this.LoadControl(userControl);

wpCtl.ID = System.Guid.NewGuid().ToString();

GenericWebPart gwp = this.sunWebPartManager.CreateWebPart(wpCtl);

gwp.Title = webPartTitle;

this.sunWebPartManager.AddWebPart(gwp, wpz, 0);

 

So, my controls are added dynamically. So when the LoadControl will be executed the Page_Load will occur on the ascx.

I found a workaround. Before the LoadControl I write in the Sessioon a Key, and imediately after that is done, i remove that key. On the Page_Load in the user control i check the Session Key. In this way i do the InitUI only in the first normal load, not when the LoadControl is occured.

 

I really do not like this approach. Any other more elegant ideea???


Yours,
Popa D. Stelian
MCP/MCAD/MCSD
ROMANIA
2 Items, 1 Pages 1 |< << Go >> >|


Free Download:


Web:
WEB PARTS, CalendarExtender, UpdatePanel reset textbox values ... WEB PARTS, CalendarExtender, UpdatePanel reset textbox values. Last post 01-16- 2008 9:54 AM by stelianx. 1 replies. Sort Posts: ...
CalenderExtender with textBox Autopostback True - ASP.NET Forums I have atextbox and calendarextender control for that textbox for date. ..... Channel 9: Bill Hill: The Future of Reading on the Web, Part 2 ...
need help for UpdatePanel - ASP.NET Forums Programming Journal C#, Java, SQL: February 2008 Using Web.config hash for variables using add, key, and value. Use configuration (web.config) hash to set ... NET to reset a form's TextBox controls: ...
CalendarExtender - ASP.NET Forums I have a text box with a calendar extender attached, When the user click in the ... ...
CodePlex Sep 12 2008, Work Item, Modified work item: Web Parts & Tab Container .... Work Item, Modified work item: TextBoxWatermark and setting TextBox.value in JS ...
add records to a gridview from a popup window Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web. UI. ... Controls) { if (c is TextBox) { ((TextBox)c).Text = string. ...
AjaxPres custom server control containing ajax calendarextender ..... UpdatePanel – Enables you to refresh selected parts of the page instead of refreshing the whole ...
CSS Formatting disappears after JavaScript Alertbox clicked ...
End Date and Time: Would you override ScriptControl or BaseValidator for an async ASP ... How do you reset ASP.Net AJAX cascading dropdown control (client side) · Dynamically add CalendarExtender to Textbox subclass server control? ...




Search This Site:










referencing a label with variable

i want to get current computer user(who loged in) in my asp.net form

free newsticker module?

how to create an admin account

problem with installation.

error: database is read only

opening documents very slow?

how to format the date to mm/dd/yyyy in the datagrid using 0:d

progress bar on a popup window using thread

sample skin files

accessing the 'user' class from my own class? (vb.net)

redirection to localhost

asp:table

another dumb questions... where is the upload?

making sure variable is only initialized once

wrong validators are fired

simple project-insert 5 rows into sql database

accessing routine in source of other page

reusing code

dynamically set asp:image width??

unexpected password-protected page

decompile dll

problem with menu control and flash movie

regarding : my club site

ms exchange module?

build calendar dynamical

how to delete a module manually...

preinit in usercontrol

system.net.mail - email sending no longer working

to call a javascript function.

 
All Times Are GMT