i am working on a site where client wants to add the pages from the admin panel to existing website( from the web browser) but static contents like text etc.
We've had a requirement from a client to move a site that is running on it's own domain to a subfolder of another app.
I've acheived this using ISAPI rewrite proxying.
However, there is one form that does a post back in the site. The generated url for the action from ASP.NET is "/sign-up.aspx?". This sends the postback to the root of the site.
I want to change this to "sign-up.aspx?" (no leading slash). This would be fine if I wasn't using Master pages as I could get a reference to the form and change it's action (this is .NET 3.5 SP1). I've tried to use the following code in my control to get a reference to the form but it doesn't seem to do anything. It finds the form but the action is not set to the value.
HtmlForm form = ControlLocator.FindControl<HtmlForm>(Page.Master.Master, "form1"); form.Action = "sign-up.aspx?";
This is in Page_Load and ControlLocator.FindControl is a port of this http://www.west-wind.com/Weblog/posts/5127.aspx
I have a website that's in Classic ASP on a hosted server. I'd like to be able to create some "virtual" pages so I can specify google-friendly URLs that translate to ASPs [URL] this_is_the_help_page instead of [URL]admin/helpsubsystem/help.aspx?current_user etc As the server also supports ASP.NET - could I use an HTTP Handler to intercept these calls and do any necessary translations?
I create a menu structure from a compiled class that returns an unordered list with ~/ menu options. On my localhost, they show up as [URL]
I actually have to pass the Application Path to the function to prefix the URLs. The problem, however, is that we moved the application to our development server, and now the URLS show up as:
I'm debugging a site that is deployed to the site root on the production server, but in my local copy, under the built-in, debugging web server, the URL's include the 'site name'. E.g. my local site is 'PVLive', so all URL's are 'localhost:nnnnn/PVLive/mmmm.aspx'. Certain URL's are hard coded in the site's pages to use paths relative to the root, e.g. I get errors when code tries to redirect to 'localhost:nnnnn/Index.aspx'.
Can I do something to keep the 'PVLive' site name out of the URL's?
We currently have two applications that will be using this. One is a web application, the other a desktop app. Both of these require users to login/authenticate, the same credentials can be used for either application.I want to build an automatic login mechanism that will fill in all the various login/order details and be able to call this from either app mentioned above. I've been thinking that the best way to do this is to pass this information encrypted through the URL. ie https://mysite.com/TakePayment.aspx?id=GT2jkjh3....
Since we don't want to integrate the payment processing too tightly into the desktop app to reduce our PCI scope, we decided to have it open the browser to a central, secured payment page through a simple shell execute with the full URL causing the default browser to open that page.Originally we were using AES for the encryption, but this is currently being re-examined as we would prefer not having to give out the key to the end user (AES is symmetric, symmetric encryption = both parties need the private key, why bother even encrypting then since we're going to be distributing the app?) So I'm looking at switching it over to use Public Key Encryption with the built in RSA routines within .NET
After coding up the RSA portion I noticed most examples on the net used 1024bits for the key-length, I went with this and now have our portal working with public key encryption, however the URLs generated are much much longer than when I was using AES so it made me start researching what the max limits for URLs are. http://www.boutell.com/newfaq/misc/urllength.html Says that IE is the limiting browser at about 2048 characters in the path portion. My initial tests with the RSA encryption show my urls will be around 1400 chars long.My questions boil down to this:1) Is there a better way for passing information from a desktop app to a website that I'm not thinking of? I'd prefer it be just as easy to use from another web page as it is from the desktop, hence my current solution.2) Is 1024 bit RSA keys necessary? Or overkill for something like this? A shorter key would mean shorter encrypted text right?3) Are there any other unforeseen problems with URLs in the 1200-1400 character range? Proxies? Firewalls? Web-Accelerators?
Is it possible with ASP.NET Master Pages to create content pages dynamically?That is, I know we can create content dynamically, but the content pages themselves,can those be created programmatically? I want to give my users the ability to define new content pages (i.e. Categories: Sofas, Tables, Lamps, and add/delete as they see fit) through a management panel. The resulting content pages should have proper URL naming, so that they index properly.An example: http://www.example.com/products/Lamps/contentpage.aspx.Is there a demonstration of this somewhere I can view?
i have a function that pulls URLs from various web resources. needless to say some are full valid URLS and some are relative as per the HTML of the page. below is my asp.net/ c# logic i derived for examining the URL and then generate a full usable URL from whats pulled from the site...
NOTE: origianlurl is the full url of the first searched page, and relativeUrl is a url found within the searched page (it can be a full www.site.com or a /contactus.html) private string ResolveRelativePaths(string relativeUrl, string originatingUrl) { if (relativeUrl.StartsWith("http") || relativeUrl.StartsWith("www")) return relativeUrl; if (relativeUrl.StartsWith("/")) { //get main url something.com [code]...
There is a pattern in ASP.NET - whenever there is a piece of markup that generates code (like the .aspx/.ascx files in WebForms or .cshtml files in MVC3), these files are dynamically compiled at runtime. aspnet_compiler will produce another assembly for them, which references your code-behind assembly. This approach seems awkward to me and I don't understand why it hasn't been discontinued already. A much better approach (in my opinion) is like in Winforms or resource files - you have your .whatever file, and then there is .whatever.desginer.cs file. This designer file is created at runtime as you type. When you compile, the compiler doesn't care about your .whatever file, it just takes the .whatever.designer.cs file and produces a single solid assembly. This provides several benefits:
You can inherit your forms from each other, similar to windows forms; You can always see the code that is being generated, possibly adjusting your markup to generate better code; You can easily instantiate strongly typed instances of your forms;
The only benefit I can see from dynamic compilation is that You can change the markup file anytime and don't need to recompile the app.To be honest, I've often wanted for one of the first three benefits, but never for the last one. Recompiling the app to see your changes isn't that big of a deal. Especially since you have to do it anyway when working with code-behind, where the most of your time will be. And when you deliver your app to the client, you deliver it as a monolithic, precompiled block. When you update, you update everything, not just individual .aspx files - there's no point to. why is it like this? What am I missing?
You fetch the user's IP address and based on his/her country you redirect the user to a specific webpage. Now, how do you change the master page dynamically? This is how I am redirecting the user :-
Geolocation Error with IP Address 127.0.0.1
It's not like the user clicks some button or something and you then change the master page. I want it changed when the user is redirected, so how exactly do I go about it?
public partial class testClass: System.Web.UI.MasterPage { protected void Page_Load(object sender, EventArgs e) { if (redirected to site1) { Use this master page1 } else if (redirected to site2) { Use this master page2 } } }
So how do I check what SITE the user has been redirected to? Also HOW to apply the specific master page now that the user has been redirected?
I just need an idea how to go about it.
[EDIT] please check the code block below. How do I fetch the URL that the user has been redirected to? I actually need just the "iso3166TwoLetterCode" variable's value (see the link to my earlier question, please) and based on that will be changing the master page. I can't figure out how to fetch that value or even use that class (that's got this variable) in my testClass.
protected void Page_PreInit(object sender, EventArgs e) { if (user Has been redirected to www.site.in ) { this.MasterPageFile = "master1.master"; } if (user Has been redirected to www.site.fr ) { this.MasterPageFile = "master2.master"; } }
I created this master page file and in its Page_PreInit added the code to change master page at run time after detecing a visitor's country:-
Now, while researching I came across this thread that says "Setting the master page in Page_PreInit event is against the design and spirit of MVC..what is this supposed to mean ???
If not this way, how else am I supposed to change master pages at run time???
There's a master page that is used by all the pages in the app. This master page hosts a dynamically generated menu. Opening of pages etc. is almost always handled through Response.Redirect(). Here's the catch:
I login to the app and it shows me a default page, with the master page at the top. So the Page_Load() fires for the master page. So far good. Now I go through the menu and select an item. Clicking the menu triggers a postback where the Page_Load() of the master page is called again. After that the Page_Load() of the desired content page is fired, and then the Page_Load() of the Master page is fired yet again! So each time I click a menu item, the master page is loaded twice!
any code or control used to allow clients to manage their own articles/news (text + images) on their asp.net websites? I mean only text and images with exact structure, not modifying the whole layout.
Due to the size of content, I would like to dynamically create tab pages on a page dependant on user action. Also, I would like to have the ability to allow the user to close/dispose of the tab pages. Is there anyFREE user control that can do this?
i have a setup.aspx page where in i select the theme with buttons so if i click on a button the theme should reflect in all of my pages of project.so how can i write the code do i need to call it in each page.how can i set the initial page to do so.
I am Using "Visual Studio 2005 Professional" .I start a new WEBSITE Project .I chose ASP.NET website and i work on it.i want to publish it but i cant?i want to Upload this WEBSITE Pages in My Domain.
I'm trying to figure out how to use SSL for only certain pages on my website. It's an ecommerce site, and I don't want the whole site to use SSL, only the checkout areas. I'm not sure what's needed to set this up, is it all IIS, web.config file, etc. I'm hosting with Discount ASP.Net, and will purcase an SSL cert through them for my site.
What I want is that I can add /edit or delete view pages. I don't want a complex content management system , just looking for any examples where one can add simple view page, I have no idea how to add action result dynamically, programatically on a controller page in mvc2.
I have 1 UserControl and 3 aspx pages.3 aspx pages are using this same UserControl.UserControl have button hen i clicked the button of usercontrol i want to save individual aspx form data. that should be dynamic
I am using flow player for my online tutorial site, which passes values dynamically. i.e. i am passing course id values, each id values having separate videos. Here is my code:
My application I am using pagination.Using pagination i bind the records with listview control.
I generate the buttons dynamically according to the number of pages which is calculated from number of records returned from dataSource.when i click on a dynamically generated button its corresponding event handlers methods should get evaluated.Since asp.net page is stateless I can't keep the state of that dynamic controls after any postback.
Just Now I have seen the Article "How to get the Id of Control that cause postback in asp.net?". I got some idea from that article. Any example for "Creating link buttons dynamically and handling its corresponding event handler in Asp.Net".