MVC :: Passing Sensitive Information Through HTML ActionLink?
Jan 29, 2011
I did some google searching on this, but I could not find anything useful.
Basically what I am trying to do is pass some sensetive information to an ActionResult through the click of a HTML ActionLink.
The information I need passing through is, the ProductID and the User IP Address.
So just to clarify:
1) User clicks { I like Product } link (HTML ActionLink)
2) That sends the Product ID and the IP Address of the user to the ActionResult in the Controller.
View 11 Replies
Similar Messages:
Nov 2, 2010
I have a need to show sensative information but I would only like it available on screen for 2 minutes, and then after it dissapears.
Since this is part of my web application, I would like the user to stay logged into the web site before and after viewing the information, but in order to view it, I would like them to re-enter their username/password.
Are there any directions I can be pointed into accomplish this task?
View 1 Replies
Dec 17, 2010
I am creating a website that allows users to login to their gameserver remotely and send / receive commands. The connection happens via an UDP socket and requires simply the IP of the gameserver, and a password.
On my website, users can add servers to their accounts, where the server IP and password are stored in a database. Then they can connect to any of their servers, which creates a new Socket object and connects to it using the IP and password of that server.
This Socket object, embedded in an object that also stores the server IP and password, is stored in a Session variable when the user connects, and is retrieved on every page. For example, there's a page where the user can view a list of the players on the server (and kick/ban them), a page with server settings, a page with messages, etc. All these pages require the Socket connection to get their information (they send a certain command and parse the response). When I need to send a command via the socket, I need to send the password of the server each time (otherwise it does not work). My question now is: how secure is this? The password of a server is sensitive information*, but I am storing it in a session variable and sending it (using the Send command of the Socket object) to the server.
i think the Session variable is stored on memory on the server, so I don't think so, but I'm really unsure about these kind of things and I'd like to be certain that my website is secure. Well, I think it will never be 100% secure but I want it to be at least not worth the effort for someone to hack the password. If it takes a lot of trouble then people wouldn't bother, but I don't want to find out that people's passwords are being thrown out on the street (so to speak) and that my website is completely insecure...
View 6 Replies
Jul 14, 2010
Im saving sensitive data from my asp.net web app back to a database on another server. I have set up encryption on the database. Do I need to set up more encryption in the code behind of the web app and encrypt the data there then pass the data to the database or should I pass it as it is and then encrypt it in my stored procedure.
View 1 Replies
Oct 12, 2010
I am trying to pass the value that a user enters into a html.Textboxfor to an html.Action link. As shown below :
<%=Html.TextBoxFor(m => m.OrderQty)%>
<p class="button" >
<%: Html.ActionLink("Add to cart",
"AddToCart",
"ShoppingCart",
new { id = Model.Product.ProductId, Qty = Model.OrderQty }, "")%>
</p>
But when i put a breakpoint in the AddToCart Qty is always 0 :-(
View 1 Replies
Feb 18, 2010
I have a Microsoft MVC project with an action "Foo" whose view ("Foo.aspx") contains the lines:
<%= Html.ActionLink("mylinktext1", "bar") %>
<%= Html.ActionLink<MyController>(x => x.Bar(), "mylinktext2") %>
When I hit this from a web browser or load it from an AJAX call, it properly returns:
<a href="/bar">mylinktext1</a>
<a href="/Bar">mylinktext2</a>
But when I call the action from another view like this:
<% Html.RenderAction<MyController>(x => x.Foo()); %>
Then the links are rendered without targets.
<a href="">mylinktext1</a>
<a href="">mylinktext2</a>
Why would this be happening, and how do I work around it?
View 1 Replies
Jul 1, 2010
i have an actionlink that doesnt seem to work as it should.
i am trying to pass a parameter to a URL that is in a different area and it isnt carrying the parameter.
[Code]....
the link generated is;
localhost/user/vacancy/details
whereas what i want is;
localhost/user/vacancy/details/6
View 3 Replies
Dec 18, 2010
Im using the HTML.TreeView to render my code structure like this :
<%= Html.TreeView("CategoryTree",
Model.CategoryList,
l => l.ChildList,
l => l.Name + " / <a id="treeLnk" + l.Id + "" href="JavaScript: OpenAddDialog('" + l.Name + "', " + l.Id + ") " title="Lägg till" >Lägg till</a>" +
" / <a id="treeLnk" + l.Id + "" href="JavaScript: OpenChangeNameDialog('" + l.Name + "', " + l.Id + ") " title="Ändra namn" >Ändra namn</a>" +
" / <a id="treeLnk" + l.Id + "" href="JavaScript: OpenDeleteDialog('" + l.Name + "', " + l.Id + ") " title="Tabort" >Tabort</a>") %>
This work fine, but now I need to include a action that redirects to another controlleraction.
I have tried to ad a Html.ActionLink but this does not work?
View 1 Replies
Jul 31, 2010
Html.ActionLink("<span class="title">Retry</span><span class="arrow"></span>", "Login", "User")
If I execute above code in ASP.Net MVC 2, I get the following output on my screen:
How do I disable the escaping of the code, so my span is within the ActionLink, and not displayed as output?
I know this is expected behavior, to keep it safe, but I want it to interpret the HTML code I pass as a parameter.
View 4 Replies
Oct 19, 2010
I wish to return the following output
<a href="#"><img src="/images/icons/tick.png" alt="" />More info</a>
If i do the following the content is html encoded.
<%= Html.ActionLink("<img src='/images/icons/tick.png' />More info", "OrderRegion", "Campaign", new {id = Model.Campaign.Id}, null) %>
How can i disable the html encoding?
View 2 Replies
Dec 18, 2010
I'm pretty new to ASP.Net / MVC 2. Can anyone explain how to use the Html.ActionLink thing? I understand that the first parameter is the displayed text, but for the second one, what is the action name?
View 1 Replies
Jul 4, 2010
I have an ActionLink: <%: Html.ActionLink("MyAction", "MyAction") %> I would like to use a button instead. Something like this: <asp:Button ID="Button1" runat="server" Text="MyAction" /> What do I need to do to make clicking the button perform the same action as clicking the ActionLink?
View 1 Replies
Jan 5, 2011
I'm showing a small table with a list of usernames, and I want an ActionLink next to each username to Edit the user on another page.
[code]...
The usernames display correctly, just the link doesn't show up. I'm not sure why it wouldn't throw an error instead.What am I missing here?
View 2 Replies
Jan 25, 2011
Over the past 3 days I've been trying to do everything in MVC. I want to learn this awesome technology.
I have just faced a problem with Html.ActionLink and I can't figure it out ! Here is what I have in my Home Index View:
[Code]....
View 8 Replies
Jun 28, 2010
I was reading the ASP.NET MVC Best Practices article by Rashid, and got stuck in his description of creating UrlHelper extensions. Doing this is easy enough, and I've adopted the practice into all of my projects. I noticed, however, that Rashid used Url.Content to generate the url for the home page, and Url.RouteUrl for all the other urls. Why is this? What is the difference between the two?
The link to the blog post is here:
http://weblogs.asp.net/rashid/archive/2009/04/01/asp-net-mvc-best-practices-part-1.aspx
I've used Html.ActionLink in my Views, but I'm wondering what difference it would be if I used Url.RouteUrl instead. Does anyone have a good grasp of what makes these helpers different, and where they are best used?
View 1 Replies
Aug 12, 2010
I assume this link is correct
Html.ActionLink("Edit", "Edit" , new {Controller = "Item", id = item.Product_GUID});
the books tell me things i have read etc.i should render html as <a href="/Edit/Item?id=foo>Edit</a>
I am sending them to "another controller" to edit the item...
But this is not rendering the hyperlink in my browser, UGH....
this code is in a ascx page so i can call it with partialaction.
All i can think is that its not working because its 5am and i have been up since 9am yesterday..
View 5 Replies
Feb 15, 2011
I m facing a problem in WegGrid MVC 3 razor, my code:
[Code]....
How to merge the Edit & Delete links into the same column (Actions)??
i tried to create two (item) in same column, but i get error message.
View 7 Replies
May 7, 2010
Is there a way to stuff my ViewModel into an Ajax.ActionLink? edit I'd like to take my 5 search fields on my page which are bind to a view model and send it along my .ActionLink as my object value parameter.
View 2 Replies
Sep 8, 2010
how to insert image in html.actionlink - asp.net mvc? i did it so, but it doesnt works.
<a href="<%= Html.ActionLink("search", "Search", new { searchText = "txtSearch" }, null); %>">
<img alt="searchPage" style="vertical-align: middle;" height="17px"
src="../../Stylesheets/search.PNG" title="search" />
View 2 Replies
Dec 6, 2010
I have a route (the first one listed) which looks like this:
routes.MapRoute(
"TopicRoute", // Route name
"forums/{forumSlug}/{topicSlug}", // URL with parameters
new { controller = "Forums", action = "Topic"} // Parameter defaults
);
I can browse to: /forums/my-forum/my-topic and the page loads fine. Yet I have a Html.ActionLink that looks like: @Html.ActionLink(item.Title, "Topic", new { forumSlug ="my-forum", topicSlug = "my-topic" }) And it won't generate the correct link syntax for me? It generates: <a href="">My Topic</a>
View 1 Replies
Mar 22, 2011
I'm having problems getting my CSS class to style an actionlink inside a html.partial. In building my test site, I've used the template beginning from ASP.NET and the standard login portion. My Index page works fine as the _Layout.cshtml does reference my css page. In _LogOnPartial, I have the following listed (there is more but this is what's important I believe):
else {
<text>
<ul style="display:inline;">;
<li style="list-style:none; display:inline;">
@Html.ActionLink("Sign In", "LogOn", "Account", null, new { @class = "signin" })
</li>
My CSS for "signin" is:
.signin {
text-decoration: none;
font-family: Helvetica, Arial, sans-serif;
font-weight: bold;
color: White;
}
When I look at the source for the page after debugging, it shows:
<a class="signin" href="/Account/LogOn">Sign In</a>
That looks right but it's not showing it correctly. The font isn't Helvetica and it is underlined and not white. I don't reference the css sheet in the LogOnPartial but I didn't think I'd have too.
View 2 Replies
Sep 28, 2010
as part of my web app i have a series of buttons created using HtmlActionlink e.g
<%=Html.ActionLink("Swap User",
"Index","Home")%></td>
However my buttons need to be translated into difrent languages depending on the country the user is in Im translating the button lable text fine in my controller and passing it into the view , but now im alittle stumped over syntax Id like to replace "Swap User" above with
<%=Html.Encode(ViewData["swapUser"]) %>
but im failing miserably finding the right syntax
View 2 Replies
May 25, 2010
I've never been able to understand why it is that some things are made in a particular way, and Html.ActionLink is one of these. In Global.asax, if I want to create a route, it has the format:
[Code]....
The order of the necessary parameters here is "name/controller/action/extra params". When using Html.ActionLink, the parameter order is "name/action/controller/extra params", which is much the same but with two of them switched around. To make things more confusing, the rendered html from the Html.ActionLink has the original order "controller/action/extra params" with the name inside of the anchor tag. Why do this? It's easy enough to memorize that the order is switched for absolutely no reason I can discerne, but why do it in the first place?
View 8 Replies
Jul 23, 2010
I need to disable the Html.ActionLink() after clicking on it. Means i want to populate all the records from database after clicking on link but after populating hat link should be disabled.
View 5 Replies
Jan 29, 2011
Is there a way to add a Html.ActionLink through javascript? For instance, I have this Edit function in my controller:
public ViewResult Edit(int companyID)
{
....
}
And I'd like to do something like this in javascript:
var id = $("#hdnID").val();
$("#editLink").html(<%: Html.ActionLink("Edit", "Edit", new { id }) %>);
A bit of a crude example, but it's basically what I'd like to do. Is it at all possible?
View 3 Replies