.net - Username Parameter Coming Back With More Than Gave It?
Mar 15, 2011
This is really weird - I've got a MVC app running, including a Login method in my ServicesController class:
public ActionResult Login() {
var p = Request.Params;
var userName = p["username"];
var password = p["password"];
// etc...
}
View 1 Replies
Similar Messages:
Mar 29, 2010
for SEO purposes, instead of refreshing the page every click of a product, is it possible to click on the product and when the server comes back with the response, to change the URL of the page to reflect the new link to information currently on page?
point is to have ajax redraw the product details portion of the page but have SEO friendly url's displayed so if people want to bookmark the currently selected product, it will bookmark the right url instead of the generic one to access the products page..
For example... here's my entry point:
Products.aspx
product1product2product3 If I were to click product1, the request goes to the server with roducts.aspx?id=product1 but the url is still products.aspx on the response meaning that when people bookmark the product1 item, and they send the link to a friend, the friend always gets the generic product.aspx page.
I'm trying to get around this without refreshing the full page (postback).
View 3 Replies
Jun 23, 2010
I have a website (not web application). I deleted all references in the code to some DLLs and deleted the dlls themselves, but
when I recompile they keep coming back. I tried with resharper and read 100 articles, but I can't get rid of those dlls! )-:
How can I get rid of the DLLs?
View 1 Replies
Jul 8, 2010
I have a simple ViewModel with 3 properties...I have some javascript going on where if a link is clicked, JQuery sets the values for 2 textfields (1 hidden) and a submit button where i process the rest of the Model on [HttpPost] - but for some reason some fields (the ones NOT set by javascript/JQuery) are coming back null - while on the page there is clearly values in them
[Code]....
And my Controller has the HttpGet and HttpPost, and a method that creates the nodes for the JQuery tree.
When you click on a node, this is when some values are set via javascript
[Code]....
View 4 Replies
Feb 17, 2010
Let's say I have two pages on the same ASP.NET C# WebSite:
Page1.aspx does things in the Page_Load event
I navigate to Page2.aspx using the menu
Page2.aspx does some things then Response.Redirect back to Page1.aspx
Page1.aspx cannot do things in Page_Load event this time because it never fires.
I tried to turn off cache declaratively, tried using true for endResponse in my redirect... nothing seems to make a difference.
View 5 Replies
Jul 6, 2010
My web site is integrated into a client web site. Client web site reaches out to my site through an Xml request and I return Html embedded in an Xml response. Client site then displays the Html in an area on a page on their site. All is well so far...
Now, there is a link on the Html that does an HttpPost back to my site which causes a re-direct to another page on my site. i.e. [URL] -> HttpPost -> [URL]-> Response.Redirect("CookieTest.aspx"). Still, all is well. [URL]
All of the above can occur without authentication to mysite. Where I start running into problems is when CookieTest wants to do a FormsAuthentication.SetAuthCookie(). If I put a button on CookieTest that does FormsAuthentication.SetAuthCookie() and then Response.Redirect("SecurePage.aspx"), still under [URL], the SecurePage does not recognize the authentication because the auth cookie is not present.
1. Navigate straight to CookieTest.aspx
So I simplfied the problem into basic cookie set/read excercise and used the code below to test out cookie writing/reading ability. When I call the page directly from the browser I see that on initial load the response cookies are empty. Then on button click I see that the cookie is properly set in the response. Then on subsequent page refresh I see that the page load shows the request cookie.
2. Navigate to CookieTest.aspx in an HttpPost from [URL], as mentioned above.
Now on button click I see the cookie in the Response but do not see it come back in the Request of subsequent page refreshes, as if the client browser is rejecting cookies set by my server.
3. Navigate straight to CookieTest.aspx, then do the HttpPost from [URL]
In this case, since the cookie was set during a straight navigation to CookieTest.aspx, the cookie is present in the subsequent HttpPost/Redirect from [URL]. CookieTest.aspx has full access to the cookie and can even delete it.
4. Have CookieTest.aspx pop a new browser window simply sets the cookie and closes itself down.
Similar to #3, if the cookie is set through a popup window and then CookieTest is refreshed the cookie is present in the Request.
Notes:
The code does prove that the client browser accepts cookies.
When my page (CookieTest.aspx) is shown within the frame on the [URl] page, during any link back to my server, the Request.Url.Host shows my domain.
[code]....
View 3 Replies
Mar 2, 2010
My stored procedure requires an input parameter -- @CompanyName -- and has one output parameter - @CompanyID. This is how I always handled stored procedures that did NOT use output parameters. How do I grab the value coming from the output parameter?
[Code]....
View 14 Replies
Mar 23, 2011
I had a .net 4.0 vb.net page that was setting session variable and setting a hidden form value to the same value. It was a paypal buy now button. When the user selects it, they are sent to paypal for payment. If the transaction is good, they are redirected back to another page on my site and a hidden value is sent back with the invoice I originally sent them. They are sending the form value, but my session variable does not available.
From the user point of view it's all seamless.. Is it the same session? And should my session variable be available?
View 2 Replies
Dec 24, 2010
I have a page in which I am not using cache by using this code:
HttpContext.Current.Response.Cache.SetExpires(DateTime.UtcNow.AddDays(-1));
HttpContext.Current.Response.Cache.SetValidUntilExpires(false);
HttpContext.Current.Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches);
HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
HttpContext.Current.Response.Cache.SetNoStore();
Now I want to know: Is there any difference between coming to this page using a proper link or coming back using browser back button, or is there any way to detect this?
View 2 Replies
Aug 17, 2010
I'm having this very annoying issue.Trying to make ASP.NET profile work in my MVC2 application.This is the C# code:
[Code]....
Here is the web.config file:
[Code]....
And finally the controller action:
[Code]....
As soon as I submit the form I get an error. I can't even debug C# as the error occurs before stepping into
public ActionResult Create(UserProfile model, string submitButton)...The error is:
Server Error in '/' Application.
Value cannot be null.Parameter name: username
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentNullException: Value cannot be null.Parameter name: username Source Error:
[Code]....
Stack Trace:
[Code]....
[ArgumentNullException: Value cannot be null.
Parameter name: username]
System.Web.Util.SecUtility.CheckParameter(String& param, Boolean checkForNull, Boolean checkIfEmpty, Boolean
[code]...
View 5 Replies
Jul 13, 2010
I have a standard Login form
<asp:Login ID="lgnExcel" DestinationPageUrl="login/data.aspx" OnAuthenticate="Login1_Authenticate" runat="server">
Is it possible to attach the Username as a query string with the DestinationPageUrl or reference the value in the code behind. I've tried lgnExcel.UserName.ToString()
View 2 Replies
Jan 19, 2011
I have a Stored Proc which uses a field in the database. that ends up being the user.identity.name. So, when the page loads, it grabs that name and uses it in the stored proc, which I'm which I'm wanting to designate in the sql datasource. But it only gives me choices of querystring, cookie, session, control, etc. My question is how to reference that variable as the parameter in the datasource?
View 3 Replies
Jul 16, 2010
[Code]....
returns the error: The parameter 'username' must not be empty.Parameter name: usernameI want to check if a user is logged. If not logged in redirect to loginerror.aspx.
View 9 Replies
Jul 23, 2012
I have an ASP.NET VB website in which I am using the Membership functionality to authenticate users. I am doing this through the Login control on the HTML page. I have working that it will authenticate the user and then opens a welcome screen in which I have a button they can push to open a Reports.aspx page. On that page I have a dropdown box that is being populated from a datasource connection query to my SQL Server database table. It is a hard coded query but want it to query the table off the username text value that the user provided on the login (i.e. select <something> from inventory where username = <username>). I have not behind code but only HTML at this point. Here it is ...
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Login.aspx.vb" Inherits="Login" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
[Code] .....
Here is the Reports form that has the dropdown on it:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Report.aspx.vb" Inherits="Report" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
[Code] .....
View 1 Replies
Apr 27, 2016
i'm a beginner in asp.net and c# , i have a question :i have 2 pages :
1- localhost:12345/show_profile.aspx?id=35
1- localhost:12345/Edit_profile.aspx ( with save button )
i try to redirect 2nd page with parameter (?id=35 ) after button clicked with Delay 3 sec .i can assign the url to var with url.Ref function , and call it but with out delay.
View 1 Replies
Jan 14, 2010
I use button " text=Back" and in the code i write the ...
Response.Redirect("show_pro.aspx");
and this page "show_pro.aspx" is linked with tow pages send value in manner "Get"
ex:
show_pro.aspx?id={0}
show_pro.aspx?pic={0}
the question :
How can i back to the real redirect previous page with the same parameter send when i click button ' back '?
what can i write instead of this code ....... Response.Redirect("show_pro.aspx"); ??
note : i use c# coding
View 12 Replies
Oct 29, 2010
I have a web form and I use jQuery/AJAX/JASON to send objects to a web service using
$.ajax({
type: "POST",
url: "SynchroniseCustomers.asmx/synchroniseCustomers",
data: JSON.stringify(customerObj),
contentType: "application/json; charset=utf-8",
dataType: "json",
error: function (xhr, status) {},
success: function (msg) {}
});
From the web service I want to check if the insert into the database was successfull, return a variable with an ID and pass this ID to a function. In the object I have the ID so I could have
success: function (msg) {deleteCustomer(ID);}
But this only checks if the data was passed to my method in the web service? I have followed this example http://encosia.com/2009/04/07/using-complex-types-to-make-calling-services-less-complex/ and in the class Person I get a message back from the database server telling me if the insert was successfull or not so like
if (successfull)
{
return ID;
}
is there a way to get this ID back to the web form and use this in a variable?
View 1 Replies
Aug 16, 2010
I have a simple model where a Person has Gifts. I have a view which is a list of Gifts belonging to one Person.
My problem is with the Create action for a new Gift. I want it to default to the PersonID that we are already viewing the list of Gifts for. I tried simply passing the last PersonID (they are all the same)
Html.ActionLink("Create New", "Create", new { id = Model.Last().PersonID }) which works fine if there is already at least one Gift for that person but if this is the first Gift I don't have a value.
My Gift List controller knows the PersonID I want to pass but the view doesn't.
How do I pass this PersonID from my Gift List controller to my Gift Create controller via the Gift List view? Or is there a better way to do this?
View 2 Replies
Mar 12, 2010
How to update username of current logged username?
View 10 Replies
Feb 22, 2011
Using Vb.Net 2003 Asp.Net 1.1
I have a dynamic data bound drop down list, when the user selects thier selected item I have to use the autopostback feature.
Problem is: when the page comes back it is at the top of the page not where i have the control.
I don't really need it to focus back on the dropdownlist but to scroll to it, I want to do it in the code behind.
Any "New" ways to do it, I mean new as in code from like 2010 instead of old code from the early days.
I really don't want to use Page.Register new Script...... code if I can avoid it.
What would be cool is a ScrollToControl() Function for my code behind that worked but didn't register script.
View 3 Replies
Oct 15, 2010
[Code]....
I have created a back button on my asp page. However, I would like this back button a a sinlge click to return the user to the page 2 pages before. I have tried to enter the history.back(2) but with no luck it does not work.
View 5 Replies
Aug 29, 2010
I have a cascading dropdown. After the dropdown is populated(it is in another file) i would like to return back to the original form where the control is placed. is there anyway of doing it
View 4 Replies
Jun 24, 2010
I've created a Sign Out link on my page, just like the one you see on the top right hand corner of this forum.
This is the code i use :
<asp:HyperLink NavigateUrl="~/Login.aspx" ID="hypSignOut" runat="server" Text="Sign Out"></asp:HyperLink>
However, after signing out, I click the back button on my browser, I can still go back into the site. How do I prevent this?
View 3 Replies
Jul 7, 2012
i m having problem with logout code in asp.net with c#. this logout code should end session, disable browser's back button and and if somebody try to login by paste the url of any user account page.i used this code in login page
protected void Button1_Click(object sender, EventArgs e)
{
Session["name"] = TxtUserName.Text;
}
and in logout i used this
protected void logout_Click(object sender, EventArgs e)
{
Session.RemoveAll();
Session.Abandon();
Response.ClearHeaders();
Response.Redirect("login.aspx");
}
nothing happening back button is still visible
View 1 Replies
Apr 20, 2010
I am creating a website and I want to know that user is coming from where, like from google, bing, asp.net, any other site. Is their any way to find out in asp.net ??
View 1 Replies