Outputcache Doesn't Work With Routing?
Feb 4, 2010
I'm using routing from System.Web.Routing without MVC in a standard ASP.Net Web Application Project application. This is mostly done to get neater urls in the portal we are developing (instead of ~/default.aspx?contentid=123 we have ~/{contentsubject}. The portal is not authorized and all info is in the url so in a caching scenario we can cache complete pages.
When I tried to enable output caching I noticed that no caching was done. It seems that the outputcache page directive is completely ignored. Is this true or am I missing something? Can this be fixed?
I made a small test app (I uploaded it to [URL] that just contains a page, Webform1.aspx, that uses a master page and a user control. All three output the current date and time.
When I request http//localhost/OutputcacheTest/Webform1.aspx the 10 second caching works as expected, i.e. the shown time only updates every 10 seconds.
The app also defines a wildcard route that catches all requests and returns the same Webform1.aspx as a handler. So when requesting http//localhost/OutputcacheTest/myroute the same page is executed but now the caching doesn't work, i.e. the current time is shown on every request.
Note: When using the built-in development web server both scenarios work, only IIS seems to have this problem.
Does anyone have a a solution or work around for how to enable output caching in this scenario?
View 2 Replies
Similar Messages:
Jul 20, 2010
I tried everything I could find, but still does not work on IIS routing.
View 2 Replies
Jan 5, 2011
I just testing the url routing. I plan to route url like that site.com/cat/{name}And I deal with it on cat.aspx
The problem is that I get 404(by firebug). The problem is that it doesnt even get to my asp.net error handler.
As it seems it stuck on IIS or doesnt even get to the IIS.
I'm on shared server so I dont have access to the IIS, so I cant get logs or configure things..
View 3 Replies
Jun 24, 2010
I am using URL routing in asp.net application (not MVC) . I have Admin folder in my aaplication which has admin related aspx pages with seperate web.config. I have seperate login form for admin users which is placed in admin folder itself. My issue is whenever I hit [URL] (which I want to go to login form for admin)- it tries to authenticate and goes to login url mentioned in web.config of root folder.
Note: Admin folder has anonymous access in root config file. Also I have set default document in config of Admin folder. I have added following line in global.asax so that routing doesnt work for files in admin folder;
routes.Add(new
Route("admin/{*resource}",
new
StopRoutingHandler()));
I am really confused what is the issue? What I am missing?
View 6 Replies
Oct 7, 2010
i'm trying to make this work for several days but it just doesn't work.
this is my code:
aspx page:
[Code]....
webservice:
[Code]....
this was downloaded from this website.
the problem is that the page loads fine but no autocomplete occurs.
View 5 Replies
Feb 5, 2010
When I try to use Routes in new ASp.Net WebaPplication using .Net framowork 3.5
Line 7: Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
Line 8: ' Code that runs on application startup Line 9: RegisterRoutes(RouteTable.Routes)
I encounter Error: Warning: BC40056: Namespace or type specified in the Imports 'System.Web.Routing' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.
Source Error: C:UsersTomAppDataLocalTempTemporary ASP.NET Fileswebsite2fec408f890149acApp_global.asax.2w_ytzx2.0.vb(26) : warning BC40056: Namespace or type specified in the Imports 'System.Web.Routing' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases. Imports System.Web.Routing. I installed VS 2008 + sp1 on windows 7. and I am using Asp.net Developement server to Run Web Application.
View 2 Replies
May 11, 2010
I am a new to WCF. I have written ajax to use a web service before, but on this project I am trying to use ajax to WCF.After I build the project and wcf using ajax, I receive the return successfully. But, 10 or more minutes later I don't get a return, the ajax calls the error function, and the fiddler returns nothing.
If I rebuild the project without any source modifying, I receive the return successfully again.
View 2 Replies
May 31, 2010
In my web.config I have configured a SiteMapProvider with securityTrimmingEnabled="true" and on my main master page is an asp:Menu control bound to an asp:SiteMapDataSource. In addition I have configured restricted access to all pages in a subfolder "Admin" (using another web.config in this subfolder).
If I put a sitemapNode in Web.sitemap...
<siteMapNode url="~/Admin/Default.aspx" title="Administration" description="" >
... only users in role "Admin" will have the menu item related to that siteMapNode. So this is working fine and as intended.
Now I have defined a URL route in Global.asax to map the physical file to a new URL:
System.Web.Routing.RouteTable.Routes.MapPageRoute("AdminHomeRoute",
"Administration/Home", "~/Admin/Default.aspx");
But when I use this route-URL in the SiteMap file...
<siteMapNode url="Administration/Home" title="Administration" description="" >
... it seems that security trimming does not work: The menu item is visible for all users. (Access to the page is still restricted though, so selecting the menu item by non-Admin users does not navigate to the restricted page.)
Question: Is there any setting I've missed so far to make security trimming working with URL routing in ASP.NET 4.0 Web Forms? Did I do something wrong? Is there any work-around?
View 1 Replies
Feb 3, 2010
I am trying to save an updated xml file to a url like this:
Quote:
//save the output to a file
xmlDoc.Save("http://www.example.com/HomeNewsLinks.xml");
But I get this error: URI formats are not supported.
Did some google search on this and it seems I need to use client.uploadFile method, but I am not able to find how to declare/define filenamexxx (below) and how to pass a username/password.
Quote:
WebClient Client = new WebClient();
Client.UploadFile("http://www.example.com/HomeNewsLinks.xml", Post, filenamexxx);
View 5 Replies
Aug 10, 2010
I used this,
<a title="Logout" onclick="javascript:document.getElementById('ctl00_ContentPlaceHolder1_LbLogout').click();" href="#" class="logout">Logout</a></li>
<asp:LinkButton ID="LbLogout" runat="server" style="display:none"
onclick="LbLogout_Click">Sign out</asp:LinkButton>
View 2 Replies
Jul 14, 2010
I am following though the examples in Professional ASP.Net MVC 2 and one of the examples doesn't work for me.
[HttpPost]
public ActionResult Edit (int id, FormCollection collection)
{
Dinner dinner = dinnerRepository.GetDinner(id);
if (TryUpdateModel(dinner))
{
dinnerRepository.Save();
return RedirectToAction("Details", new { id = dinner.DinnerID });
}
return View(new DinnerFormViewModel(dinner));
}
I understand that it's suppose to take the values from the FormCollection, and then update the dinner object with it, bit I don't see the collection get referenced anywhere.
View 2 Replies
Aug 31, 2010
I have div which it is hidden by default , when the use clicks show link the following javascript method is called:
function ChangeControlVisibility(elementID) {
var element = $("#" + elementID);
if (element.css('display') != 'block' && element.css('display') != 'table') {
element.show();
[code]....
this step works but when i call the previous method at page_load event the method doesn't work:
element.css('display') undefined.
View 3 Replies
Jul 27, 2010
[Code]....
And in default.aspx, the code is
[Code]....
But it is not working, the error is at alert(BiblePeopleArray(0));
View 4 Replies
Apr 1, 2010
I have a Gridview in UpdatePanel and a textbox in which i input a string, the row is searched from gridview onkeyup of textbox.For example when i entered "testing" one row is displayed in gridview having "Edit" command and when i clicked on "Edit" it goes to top of the row having another data is converted into edit mode but that rows is not changed into textbox.
View 8 Replies
Sep 26, 2010
I have such entities
Then I tried to retrieve node type from Node this way - Nodes node = Entities.Nodes.First(); string nodetype = node.NodeTypes.Name; but for some reason node.NodeTypes equalls null despite fact that there is some records in NodeTypes table.
View 3 Replies
Mar 18, 2011
I have a listview in which I use a pager control. When I have more than 1 item in the list view, I want the user to be able to click on the appropriate page number and go to it. Simple right?, right now the first time the user clicks on the page number, nothing changes. If they click on it again, it goes right to the page. It doesn't matter what page they click on, it ALWAYS requires a second click to display the data item.
I am using VS2010 C# as the code behind.
View 4 Replies
Mar 31, 2011
I know that UpdateProgress doesn't work with PostBackTrigger, but let me explain what i'm trying:
I'm generating a PDF document (Crystal Report) with ExportToHttpResponse that will be downloaded automaticaly by the browser.
So while the document is been generated, i'd like to show the UpdateProgress just while i'm waiting the doc is being generated, doing the UpdateProgress(or some label) to disappear.
View 3 Replies
Jan 12, 2011
I've been trying to fix something on a secure website (https) which is an Export to Excel button that generates a CSV file. It works on Firefox, Chrome , etc... but not in Internet Explorer. I have changed the headers eliminating the no-cache and also edited the IIS http header configuration setting an expiration date of 1 day. I have no idea of what can be going on and how to solve it. Do you guys have any idea of how to fix this stuff ? I've read so many posts and they're all saying the same thing... caching.
UPDATE 1 :
regarding the error I receive, I receive an IE Alert saying "Internet explorer cannot download filename.aspx from [URL]Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later. As I said, it all works out of SSL (https), but the export to excel button, breaks in https.
UPDATE 2:
I'm using these headers:
Response.ClearContent();
Response.Clear();
Response.Buffer = true;
Response.AddHeader("content-disposition", "attachment; filename=" + name.Trim() + ".csv");
Response.AddHeader("Cache-Control", "no-cache");
Response.AddHeader("Pragma", "public");
Response.AddHeader("Content-Transfer-Encoding", "binary");
Response.AddHeader("Content-Length", "2026");
Response.Charset = "";
//Response.ContentType = "application/vnd.ms-excel";
Response.ContentType = "text/csv";
View 2 Replies
Dec 21, 2010
i've log-in page in my site but log-in control doesn't work on any browser other than IE.
View 1 Replies
Mar 2, 2010
Iam trying to use a UserControl named CheckBoxControl as value for the ExpandControlID/CollapseControlID attributes of the CollapsiblePanelExtender. It works fine when I use a normal CheckBox instead.
<uc:CheckBoxControl ID="ucHaftpflicht" runat="server" OnCheckedChanged="UpdateStatus" ControlLabel="Haftpflicht" />
<asp:Panel ID="HaftpflichtPanel" runat="server">
</asp:Panel>
<asp:CollapsiblePanelExtender ID="CollapsiblePanelExtender" runat="server" CollapseControlID="ucHaftpflicht.CheckBox" ExpandControlID="ucHaftpflicht.CheckBox" TargetControlID="HaftpflichtPanel" />
When I run the site, most ajax controls on my site disappear and I get following errors in firefox script error console:
Fehler: Sys.InvalidOperationException: Handler was not added through the Sys.UI.DomEvent.addHandler method.
Fehler: Sys.ArgumentException: Failed to find element "ucHaftpflicht.CheckBox"
Parameter name: CollapseControlID
View 1 Replies
Mar 17, 2010
The forms works fine in Firefox and I was able to get an email from it. Here is the code below:
Partial Class _Default
Inherits System.Web.UI.Page
''' <summary>
''' Actions when the Send button is clicked.
''' </summary>
'''
Protected Sub btnSend_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSend.Click
If Not Page.IsValid Then Exit Sub
'Create instance of main mail message class.
Dim mailMessage As System.Net.Mail.MailMessage = New System.Net.Mail.MailMessage()
'Configure mail mesage
'Set the From address with user input
mailMessage.From = New System.Net.Mail.MailAddress(txtEmailAddress.Text.Trim()).........
View 2 Replies
Aug 25, 2010
i have set of link buttons outside update panel but when click any one of them they donot work at all , when i set the postbackUrl they make full postback my source code :
<asp:Panel ID="pnl_viewImages" runat="server">
<asp:Label ID="lbl_viewImages" runat="server" style="texalign: left"
Text="view images :"></asp:Label>
<br />
<br />
<br />
<table cellpadding="0" cellspacing="0" style="width: 100%" class ="Alternating">
<tr>
<td colspan="5">
<asp:UpdatePanel ID="updatePnl_image" runat="server">
<ContentTemplate>
<asp:ListView ID="lv_showImages" runat="server">
<ItemTemplate>
<asp:Image ID="img_showNewsImage0" runat="server" Height="300px"
ImageUrl='<%# "RetreiveImage.ashx" %>' Width="413px" />
</ItemTemplate>
</asp:ListView>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="lbtn_first" EventName="Click" />
<asp:AsyncPostBackTrigger ControlID="lbtn_last" EventName="Click" />
<asp:AsyncPostBackTrigger ControlID="lbtn_next" EventName="Click" />
<asp:AsyncPostBackTrigger ControlID="lbtn_previous" EventName="Click" />
<asp:AsyncPostBackTrigger ControlID="lbtn_delete" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
</td>
</tr>
<tr>
<td>
<asp:LinkButton ID="lbtn_first" runat="server" onclick="lbtn_first_Click">first</asp:LinkButton>
</td>
<td>
<asp:LinkButton ID="lbtn_previous" runat="server" onclick="lbtn_first_Click"><<</asp:LinkButton>
</td>
<td>
<asp:LinkButton ID="lbtn_next" runat="server" onclick="lbtn_first_Click"
>>></asp:LinkButton>
</td>
<td>
<asp:LinkButton ID="lbtn_last" runat="server" onclick="lbtn_first_Click">last</asp:LinkButton>
</td>
<td>
<asp:LinkButton ID="lbtn_delete" runat="server" onclick="lbtn_first_Click">delete</asp:LinkButton>
</td>
</tr>
</table>
<br />
</asp:Panel>`
i tried to remove the table but in vain it does not work also.
View 2 Replies
Jan 20, 2011
Iīm using in my application the control :ModalPopUpExtenter. In my computer testing localhost, it works fine. But when i put my application on my server, everything works fine except the ModalPopUp.In the page that i use it, my panel is appearing for my user, but i donīt receive any error message.I pute the dlls: AjaxControlToolkit.dll, System.Web.Extensions.dll and System.Web.Extensions.Design in the folder bin.
View 2 Replies
Aug 31, 2010
I have the following class that I have all my controllers inherit from:
[Code]....
I would like to aways redirect to the login page where // this isn't workingThe current code runs, but it still allows access to the views that I want to block when the user isn't logged in
View 4 Replies
Jan 22, 2010
I've got a problem with my title displaying with the default template. It gets cutoff in firefox and IE 8 (in standards mode) by the content div.
View 1 Replies