Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 26th, 2006, 06:56 AM
Friend of Wrox
Points: 1,935, Level: 17
Points: 1,935, Level: 17 Points: 1,935, Level: 17 Points: 1,935, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2004
Location: United Kingdom
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post
Default One more question!!

Hi Friends

Its a general problem I am facing, I am making a registration form which has a series of steps, so for these steps I am using usercontorls on one form, now in one of my steps, I make the user add a status and an image associated with it, user can add as many as status with the Add New button , then the user presses the next button and moves to the next step, but when the user presses back button to go the previous step i.e. the status step, the grid of status is not being bound, i.e. the itemdatabound even is not being called. Any ideas????

Regards
Mike
__________________
Regards
Mike
  #2 (permalink)  
Old October 26th, 2006, 07:31 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Thats because the page is being pulled from cache, e.g. the page isn't loading and refreshing the data again.

-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature
  #3 (permalink)  
Old October 26th, 2006, 07:45 AM
Friend of Wrox
Points: 1,935, Level: 17
Points: 1,935, Level: 17 Points: 1,935, Level: 17 Points: 1,935, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2004
Location: United Kingdom
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post
Default

Ya

I thought the same reason, I have used Response.Expires = -1; to avoid this issue, but to no avail. Any ideas what can be done.

Regards
Mike
  #4 (permalink)  
Old October 26th, 2006, 07:52 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Set Response.Expires = 0 not -1 and you can look into the javascript method document.location.replace() which would replace the last page the user visited with the current page.

-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature
  #5 (permalink)  
Old October 26th, 2006, 08:44 AM
Friend of Wrox
Points: 1,935, Level: 17
Points: 1,935, Level: 17 Points: 1,935, Level: 17 Points: 1,935, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2004
Location: United Kingdom
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post
Default

No luck parsons, have tried the code below to no avail:

Response.CacheControl = "no-cache";
Response.AddHeader("Pragma", "no-cache");
Response.Expires = 0;
Response.Buffer = true; (tried both true and false)

Also, couldn't get the use of javascript method you suggested. Any further help would be appreciated as this has to be completed within 2 hrs.

Regards
Mike
  #6 (permalink)  
Old October 26th, 2006, 08:53 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

2 things you can try: In your code behind for the page you dont want to cache you can do:

Response.Cache.SetCacheability(HttpCacheability.No Cache);

or on the page itself you can set this page attribute:

<%@ OutputCache Location="None" %>

(They both mean the same thing, one is just in code and the other is a page attribute)

-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature
  #7 (permalink)  
Old October 26th, 2006, 09:04 AM
Friend of Wrox
Points: 1,935, Level: 17
Points: 1,935, Level: 17 Points: 1,935, Level: 17 Points: 1,935, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2004
Location: United Kingdom
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post
Default

Well hard luck

That too didn't work, anyways I will try to manage something else, lets see.......

Regards
Mike
  #8 (permalink)  
Old October 26th, 2006, 09:09 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Thats very strange as those are the only ways to really set your cache through .NET weird.

-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature
  #9 (permalink)  
Old October 26th, 2006, 09:10 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi Mike.,

Are you sure it's a caching issue? What happens when you set a breakpoint in the Page_Load method? Is it hit once (page load only) or twice (on PostBack as well)??

In the latter case, set a hook on ItemCreated. Depending on how you bind data, ItemDataBound isn't always called, but ItemCreated is when items are recreated from ViewState.

Cheers,

Imar
  #10 (permalink)  
Old October 26th, 2006, 09:22 AM
Friend of Wrox
Points: 1,935, Level: 17
Points: 1,935, Level: 17 Points: 1,935, Level: 17 Points: 1,935, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2004
Location: United Kingdom
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post
Default

Parsons and Imar,

Thanx for the efforts, I solved the problem, but really some strange way, I would definately like some comments on this from you senior guys.

Imar, there is no Page_Load declared in the usercontrol, there is a public Init() method that is being called from the main page something like below:

((IEditProjectControl)ctlWizardStep).ProjectId = ProjectId;
((IEditProjectControl)ctlWizardStep).Init();

where IEditProjectControl is an interface maintaining ProjectId

Now how did I solve the problem, I had a label control in grid showing status name and image control showing image, both these were bound on itemdatabound event. Strangely, I removed the label control and bound directly from HTML like below:

<asp:TemplateColumn HeaderText="Status">
                                <headerstyle horizontalalign="Left" cssclass="gridHeader"></headerstyle>
                                <itemstyle cssclass="gridFirstItem" width="80%"></itemstyle>
                                <ItemTemplate>
                                    <%#DataBinder.Eval(Container.DataItem,"Name")%>
                                </ItemTemplate>
                            </asp:TemplateColumn>
                            <asp:TemplateColumn HeaderText="Image">
                                <headerstyle horizontalalign="Center" cssclass="gridHeader"></headerstyle>
                                <itemstyle horizontalalign="Center" cssclass="gridItem" width="10%"></itemstyle>
                                <ItemTemplate>
                                 <asp:Image id="Image1" ImageUrl='<%#"~/Images/Status/" + DataBinder.Eval(Container.DataItem,"ImageUrl")%>' runat="Server" />
                                </ItemTemplate>
                            </asp:TemplateColumn>

And it worked!!!!!!!!!!! Any explanations for this, can I trust that it would work fine....


Regards
Mike
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
question maheshraju ASP.NET 2.0 Basics 3 March 13th, 2008 08:54 AM
Question Ashwini Classic ASP Databases 3 January 10th, 2006 07:20 AM
Question? Calibus Classic ASP Databases 8 August 6th, 2004 08:25 AM
a question gorji C++ Programming 2 August 11th, 2003 07:41 AM



All times are GMT -4. The time now is 12:09 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.