NET WebForms - Processing String Parameters Across All Pages On Site
Jun 25, 2010
Working on an ecommerce site which will be integrated with a 3rd party vendor--that vendor uses different identifiers for stores than we use internally (i.e. their store ABC123 is our 001-321). I'm researching the best approach to inspect incoming requests for reserved query-string parameters that indicate the request is using their identifiers and map the identifiers back to our identifiers (so if the request is example.com/&theirId=ABC123 I want to transform the request to example.com/&ourId=001-321). To do this mapping I need to inspect the provided ID, execute a lookup against the database or cache, and forward the request to the specified page--limiting the modifications to just the query-string parameters (other parameters will need to be maintained, as with the details of the HTTPHeader, etc). So far I'm researching a few different approaches: Implementing it in a base Page (which already does too much, but has the benefit of our Logging infrastructure and some other injected dependencies) Implementing it in an IHttpModule Using URL RewritingUsing URL Routing (looks like routing isn't what I want, feel free to offer insight if you think it still fits) Performance cost is a consideration: the actual number of times this translation will occur will be very small compared to the number of requests not requiring it--perhaps 1%. However for another integrated site we will perform this mapping on nearly every request--would a different approach be better suited to this scenario from the previous?
View 3 Replies
Similar Messages:
Aug 20, 2010
jQuery DataTables server-side processing using ASP.NET WebForms.
Solution:
Darin Dimitrov answered the question using an example which pages and sorts, but doesn't do any searching.
Here's my basic modification of his work to make searching work on his example:
[code]....
View 5 Replies
Aug 5, 2010
I am getting this error message (in IE) when i click on any of the menu items used in my code, i pasting my code here, please review it and suggest me the corrections, i have tried reading other similar articles which mentioned increasing maxReuestLength(<httpRuntime maxRequestLength="8192" />) but it hasn't solved my problem.
<asp:UpdatePanel ID="UpdatePanel1cc" runat="server">
<ContentTemplate>
<asp:Menu
id="menuTabs"
CssClass="menuTabs"
StaticMenuItemStyle-CssClass="tab"
StaticSelectedStyle-CssClass="selectedTab"
Orientation="Horizontal"
Runat="server" onmenuitemclick="menuTabs_MenuItemClick">
<Items>
<asp:MenuItem
Text="Jan"
Value="jan" />
<asp:MenuItem
Text="Feb"
Value="Feb"
Selected="true" />
<asp:MenuItem
Text="Mar"
Value="Mar" />
</Items>
</asp:Menu>
<asp:UpdateProgress ID="UpdateProgress1" runat="server">
<ProgressTemplate>Updating...</ProgressTemplate>
</asp:UpdateProgress>
View 5 Replies
Feb 2, 2010
I am having a little difficulty trying to wrap my head around site structures. I have quite a large asp.net site, for which: Admins can see a user list, Each user can have many accounts, and for each account can have many items. I can picture this as a breadcrumb trail of editing a particular item. User List > Mr Bob > Accounts > BOB77 > Items > Item32 > Edit
User List = All the users Mr Bob = A user the administrator has selected from the User List Accounts = A list of the user's accounts 12BOB = The administrator has selected the account named 12BOB Items = A list of the items an account contains Item32 = The item that the administrator selected Edit = The action that the administrator wants to do. I can picture how this would look like if it was using ASP.NET MVC with the URL, but I am unsure how to map this out using Webforms, and in the physical filesystem.
This is what I have thought up about how I am guessing the physical structure would look like. Will this have to use session variables to achieve what I am trying to do?
/Users/User/Edit.aspx <- for editing a user
/Users/User/View.aspx <- for viewing a user
/Users/User/Accounts/Default.aspx <- for viewing all accounts
/Users/User/Accounts/Account/View.aspx <- for viewing an account
/Users/User/Accounts/Account/Edit.aspx <- for editing an account
/Users/User/Accounts/Account/Items/Default.aspx <- for viewing all items in an account
/Users/User/Accounts/Account/Items/Item/Edit.aspx <- for editing an item
Where can I read more about this kind of setup in a web application? Or, can someone point me in the direction of an available project that has this kind of layout?
View 1 Replies
Sep 23, 2010
I am executing a SSRS 2008 report from report manager so it opens in a web browser. Since it is a big report it takes some time for execution. During this time i get an error icon on the left bottom of the web browser and the execution stops. When I click open the error icon to see the details it says,
"Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 12029."
The other relatively smaller reports are coming up successfully without any issue.
I am using SQL Server 2008 R2 64 bit ent. edition and the OS is Win Server 2003 64 bit SP 2.
View 1 Replies
Feb 4, 2011
Am getting this error on clicking any of my page link.
Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 0"
How do i avoid this error.
View 3 Replies
Jan 29, 2011
I picked up a new-to-me client who had a site built in ASP.net (which I do not host).I converted the site to PHP, which worked fine.I want to set up redirects for all the pages he had in the old site (it was a small site, so there was only 8 pages).As an example, the ASP.net url for the Contact page was www.domain.com/Contact - it is now www.domain.com/Contact.php (and so on).
For 301 redirects from one PHP page to another I normally use the .htaccess file:
Options +FollowSymlinks
RewriteEngine on
#custom redirects
rewriterule OldPage.php http://www.domain.com/NewPage.php [R=301,L]
#end custom redirects
What can I do to redirect these ASP.net pages to the new PHP pages?They are all static pages with no dynamic content.
View 1 Replies
Dec 3, 2010
i'm new to asp.net, but familiar with c#, .net. i want to write a cms for asp.net, which has the pages of the website in a database. these pages contain asp controls, like asp:Repeater which have to be processed after loading the page from the database, and before sending it to the client like a normal aspx page.
View 1 Replies
Sep 23, 2010
I want to add optional parameters in my routing table.For example I would like the users to browse a product catalog like this:http://www.domain.com/browse/by-category/electronics/1,2,3 etc
routes.MapPageRoute(
"ProductsBrowse",
"browse/{BrowseBy}/{Category}",
"~/Pages/Products/Browse.aspx"
View 1 Replies
May 10, 2010
I need to know a way to process images in asp.net web pages. I need to be able to highlight a certain area of the image and put an image on top of the other, then save the image with those changes. So far everything I have seen requieres buy 3rd parties components which I can not afford, I need to develop this functionality using objects inside the .net framework, or a free component.
View 5 Replies
Apr 1, 2011
i have a report and i want to display it on a webform. Reports without parameters are working nice and fine. Reports with parameters are creating headache for me. this is the code i have written in BindReport method, which is called on page load event of the form.
[Code]....
i have tried variety of things like assigning ParameterFieldInfo to reportviewer control but, it shows me prompt on page load asking for parameter values of the report. i m using .NET 4.0 EDIT i m using push model for crystal reports. does it change the way we can pass parameters to report from asp.net
View 2 Replies
Oct 18, 2010
Simple enough I have a search feature I am wanting to impliment Routing for.Here is the routing table for it.
[Code]....
Now I want to set the postback URL for a linkbutton to go to the search page with all parameters filled in but the last one or for that matter any one of the parameters to be left blank
[Code]....
You will see in this example I left the very last one blank. Now when I do that the link does not work. If I fill in all attributes it does workso can anyone tell me how to work around this issue?
View 2 Replies
Mar 28, 2011
i am trying to call a report with a ReportViewer control using this code:
[Code]....
but i am having this error
Microsoft.Reporting.WebForms.MissingReportSourceException = the source of the report definition has not been specified.
View 1 Replies
Aug 28, 2010
I have a requirement to show an Exit Popup on one of our processing pages. I am showing the exit popup by registering a client side javascript like
window.onbeforeunload = ShowExitPopUp();
The popup executes fine if you close the window, or try to type in a different URL. However the issue is that my processing page is also performing a "Response.Redirect" on the server side once the process completes. When response.redirect happens the exitpopup also shows up. Is there a way to have the exit popup not show up in that case?
Since my server side code is running through an UpdatePanel, so I have tried registering the following, in an attempt to remove ExitPopup from client side. However this doesn't work since server side redirection happens before end request.
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(RemoveExitPopup);
View 1 Replies
Sep 13, 2010
When i'm trying to debug or view pages of my site in browser asp.net dev server doesn't turns on pages automatically and when im trying to go by url it throws me an error See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.ComponentModel.Win32Exception (0x80004005): Не удается найти указанный файл
at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at Microsoft.VisualStudio.WebServer.WebServerForm_DAL.DoLaunch()
at Microsoft.VisualStudio.WebServer.WebServerForm_DAL.OnLinkClickedHyperlinkLinkLabel(Object sender, LinkLabelLinkClickedEventArgs e)
at System.Windows.Forms.LinkLabel.OnLinkClicked(LinkLabelLinkClickedEventArgs e)
at System.Windows.Forms.LinkLabel.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)............................
View 7 Replies
Jul 1, 2010
Does outputcaching VaryByParams in webforms understand route parameters? Such that if I have a route similar to "Content/{filename}/{more}" that I could do VaryByParams="filename" and have it return cached results based on filename and ignore any values in the more?
View 1 Replies
Mar 4, 2011
What I'm looking for is a good sample of an open source WebForms site which contains demonstrations of some best practices, design patterns etc. Just want too look how experienced people apply their knowledge to build websites which can be shown to everybody without shame :)It would be good if the samples show these technologies: IoC, Entity Framework, Unit testing (with mocks), jQuery. The small samples which demonstrate the particular technology are useless as I've already examined many of them.My goal it to improve the existing huge WinForms application, so I'm not interested in ASP.NET MVC for the time being
View 1 Replies
Aug 26, 2010
With ASP.NET MVC it is pretty easy to integrate an IoC container to create the controllers. Is the same thing also possible with webforms to create the pages and controls and pass them any dependencies? If yes, where do I have to plug it in?
View 4 Replies
Jan 26, 2010
I am running an MVC 2 RC web appilcation with the majority of pages being webforms. (this is an ongoing conversionn to mvc).When people hit our domain at www.mydomain.com, I want the people to get the webform page MyDomainHome.aspx. This is the page specified in IIS as the default document. (I can't convert the home page to controller/view right now because it is very complicated etc.)
I also want the typical "{controller}/{action}/{id}" behavior. Is there a way to mix these together so people who have bookmarked my home page will still get there?
2. Also when I use the "{controller}/{action}/{id}" routing, my pages do not see the css or image folders that are specified in the master page.
View 2 Replies
Jan 26, 2011
is it possible to set a user defined timeout value on an asp.net website...i have a table that stores the time out value for each user of my website...i need to set the time out based on who logged in...i know that the default aspnet timeout setting is 20 mins of inactivity...is there any way i can circumvent this...and yes i do need to show a modal when the timeout expires and need to reset the timeout value if the user wants to continue the session or log them out if they choose not to continue...
View 1 Replies
Aug 9, 2010
In my Application_BeginRequest I have code that gets query string value ?c=FR or ?c=US and store it in cookies.Based on query string value I have either US or FR,locale is selected from locale table.If ?c=FR then locale will be fr-FR and if it is US then locale will be en-US.My code is below.
void Application_BeginRequest(object sender, EventArgs e)
{
LocalizationInfo loc = GetLocalizationInfo();
if (Request.Cookies["Localization"] == null)
Response.Cookies.Add(new HttpCookie("Localization"));
Response.Cookies["Localization"]["Country"] = loc.Country;
CultureInfo objCI = new CultureInfo(loc.Locale);
Thread.CurrentThread.CurrentCulture = objCI;
Thread.CurrentThread.CurrentUICulture = objCI;
}
public static LocalizationInfo GetLocalizationInfo()
{
string countryCode = "";
string sLocale = "";
if (HttpContext.Current.Response.Cookies["Localization"]["Country"] != null)
countryCode = HttpContext.Current.Response.Cookies["Localization"]["Country"];
if (!string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["c"]))
countryCode = HttpContext.Current.Request.QueryString["c"];
if (countryCode == "")
countryCode = "US";
sLocale = HertzRent2Buy.DataProvider.ListData.GetLocale(countryCode);
LocalizationInfo ret = new LocalizationInfo();
ret.Country = countryCode;
ret.Locale = sLocale;
return ret;
}
public struct LocalizationInfo
{
public string Country;
public string Locale;
}
Now when I run the project and in query string I set [URL] then for the very first page(home page itself) it shows me French translation,but on subsequent page,that query string parameter ?c=FR is lost and hence it shows be English translation not French translation since it does not pickup French resx file.If I manually append ?c=FR in subsequent page then it shows the French translation.Is there is way how I can make that query stringparameter available in all pages.Structure is there to hold Country and locale variables. In all pages I am calling GetLocalizationInfo() method as follow
LocalizationInfo info = some.DataProvider.Globalization.GetLocalizationInfo();
And I create instance info to pass locale and country as parameter. GetProductDetails(id,info.Country,info.locale). why my query string parameters get lost on subsequent pages.
View 1 Replies
May 21, 2010
can I include normal asp.net pages (webforms or mvc) in a Dynamic Data web application?
View 2 Replies
Jun 11, 2010
I have a site that is using Forms Auth. The client does not want the site session to expire at all for users. In the login page codebehind, the following code is used:
// user passed validation
FormsAuthentication.Initialize();
// grab the user's roles out of the database
String strRole = AssignRoles(UserName.Text);
// creates forms auth ticket with expiration date of 100 years from now and make it persistent
FormsAuthenticationTicket fat = new FormsAuthenticationTicket(1,
UserName.Text, DateTime.Now,
DateTime.Now.AddYears(100), true, strRole,
FormsAuthentication.FormsCookiePath);
// create a cookie and throw the ticket in there, set expiration date to 100 years from now
HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName,
FormsAuthentication.Encrypt(fat)) { Expires = DateTime.Now.AddYears(100) };
// add the cookie to the response queue
Response.Cookies.Add(cookie);
Response.Redirect(FormsAuthentication.GetRedirectUrl(UserName.Text, false));
The web.config file auth section looks like this:
<authentication mode="Forms">
<forms name="APLOnlineCompliance" loginUrl="~/Login.aspx" defaultUrl="~/Course/CourseViewer.aspx" />
</authentication>
When I log into the site I do see the cookie correctly being sent to the browser and passed back up: However, when I walk away for 20 minutes or so, come back and try to do anything on the site, the login window reappears. This solution was working for a while on our servers - now it's back. The problem doesn't occur on my local dev box running Cassini in VS2008.
View 3 Replies
Jan 24, 2011
I have an asp.net2 WebForms project which worked fine, including referencing a dll compiled for .Net2.
Problem is that I have now recompiled the dll for .Net4 and have also 'upgraded' the VS2010 asp.net WebForms project to .Net4 and the asp.net WebForms application won't access the dll.
The first time the dll is called I get System.NullReferenceException: Object reference not set to an instance of an object.
The new dll is accessed by other WinForms applications OK.
Whatever the problem is, VS2010 freezes and I need to use Task Manager to close it down.
View 1 Replies
Jan 2, 2011
I got a a problem when using ToolkitScriptManager on masterPage with other webForm in SUbDirectory. Everytime I run other webform in the SubDirectory there was an Error "The ScriptManager must appear before any controls that need it". Then I added ToolkitScriptManager to that page I got another Error "Only one instance of a ScriptManager can be added to the page". hmmmm then I removed the ToolkitScriptManager from the MasterPage, It's worked for that page.
on that SubDirectory I had a webConfig file.
<?xml version="1.0"?>
<configuration>
<location path="MyPage.aspx">
<system.web>
[Code]....
View 2 Replies