HTML POST problem

  • Thread starter Thread starter Yngve H
  • Start date Start date
Y

Yngve H

I am creating som pages in visual basic.NET. In one page I have a list
of items, which are collected from a database. Now, for each list
item, I was thinking of adding a button that the user can click on,
and be sent to a new page(i.e. HTML post). And on the new page I will
need to know which item in the list the user clicked on, so the button
needs to have an exclusive id of some kind. How can I do this, and is
there an alternative way to do it?

I want to avoid sending variables in the URL (html GET), as it may be
a security issue.

Any help would be appreciated
 
Hi, Yngve H,

Why don't you consider doing it in one aspx page? Like this:

- Set the CommandName and CommandArgument to some useful combination for
each button;
- Set all the buttons to have the same handler for the Command event;
- In that handler do what you intend to do in the second page with your
current design.

Have a look at the example for the Command event:

http://msdn.microsoft.com/library/e...emwebuiwebcontrolsbuttonclasscommandtopic.asp

Hope this helps
Martin
 
Can you elaborate on what you mean by a "Security issue"? Regardless of
whether you GET or POST, an end-user can see and/or tamper with the values
their browser is sending.

--
Thanks,

Eric Lawrence
Program Manager
Assistance and Worldwide Services

This posting is provided "AS IS" with no warranties, and confers no rights.
 
I have not been totally clear in my question, for that I apologize.
The case is this: I AM using .aspx pages, in which I'm using VB.NET
for scripting. Now, I already have a <code><form
runat='server'></code> on the page, so I can't make another one. Which
means i must use a normal html form (or some other asp control) for
sending data to a new page. Anyway, the list consists of a varying
number of items, depending on the users query to the database. So,
assuming I can only use a standard html form (which doesn't have much
functionalty), I can't give each item an unique ID, because that
wouldn't tell the next page which button got clicked on. But I
eventually solved the problem: I make a new identical html form for
each line in the itemlist, which each has a <code><input
type"hidden"></code> tag with a value that identifies the listitem.
That way, the next page will automatically know which form got clicked
on, and which input tag it shall retrieve an identifier from. Phew :)

But I'm sure there's an easier way to to it, but like I said, I can't
use a serverside form. And I want to avoid clientside scripts, because
many only work in internet explorer.

Thank you for the response.
 
I only mean that I don't want the user (or anybody else) to know
anything about the identifier data in the database. And an URL is more
visible than a 'post' dataset.
 
Back
Top