Set Variable

But what I need to be able to do is in the code behind set the node value to a session value and then do a redirect

What is making this difficult for me is that I want to assign these actions to an ASP Button that is inside a repeater.

So...I THINK I need to do a onClick event and point to code behind?

This works for a simple link.
I need to garb that value in code behind and set to a variable.
<a href='z.aspx?id=<%#GetNodeValue((DirectCast(Container.DataItem, XmlNode))("availabilityInfo"), "inventoryId")%>'>Link</a>

Yeh create a LinkButton to point to an event in your code behind. A Link button is a mix between a link and a button. Generally speaking a button allows you to perform and action and a link sends you somewhere. But a link button allows you to perform an action in your code behind using a link instead of a button.
Do you need to assign the value of the session just the once, to a value that corresponds to the button that was clicked? If so you can set the commandargument property of a link button and access i like this in your event:
protected void btn_click(object sender, EventArgs e)
{
LinkButton lnk = (LinkButton)sender;
string argument = lnk.CommandArgument;
}

0

lrbristerAuthor Commented: 2009-03-30

Hey guys...
Do I just type that button code into the code behind?
This button is inside a repeater and isn't showing up on my dropdown in Visual Studio

Selecting the right managed security services platform to grow your business can be a huge undertaking. Join WatchGuard and Frost & Sullivan in an upcoming webinar as we dive into the key elements of selecting a vendor platform and partnership to fuel a successful MSSP business.

As we have stated, you just need to add a property to the button that you already have in your repeated, just add the CommandArgument property to the button, and assign to it the value that you want to access (set as your session) in your code behind.
The othercode is the Click event of the button which you will use to actually retrieve and set to your session variable

@vbwizardry, thanks, ill remember that one, could come in handy :)
@irbrinster
If you use vbwizardry's suggestion in the second psot of this thread that should solve your problem. You just need to replace your button at the bottom with theone he has provided and add the event to your code behind and it should work fine