Click here to Skip to main content
15,566,366 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionQuestion About Storing Objects in the Session Variable Pin
MarkMokris4-Sep-09 13:56
MarkMokris4-Sep-09 13:56 
AnswerRe: Question About Storing Objects in the Session Variable Pin
Christian Graus4-Sep-09 14:14
mveChristian Graus4-Sep-09 14:14 
AnswerRe: Question About Storing Objects in the Session Variable Pin
tagyurit4-Sep-09 17:52
tagyurit4-Sep-09 17:52 
GeneralRe: Question About Storing Objects in the Session Variable Pin
MarkMokris5-Sep-09 3:45
MarkMokris5-Sep-09 3:45 
GeneralRe: Question About Storing Objects in the Session Variable Pin
tagyurit5-Sep-09 4:53
tagyurit5-Sep-09 4:53 
GeneralRe: Question About Storing Objects in the Session Variable Pin
MarkMokris6-Sep-09 4:36
MarkMokris6-Sep-09 4:36 
Questiongridview buttons and client side scripting Pin
compninja254-Sep-09 10:28
compninja254-Sep-09 10:28 
AnswerRe: gridview buttons and client side scripting Pin
Abhishek Sur4-Sep-09 10:48
professionalAbhishek Sur4-Sep-09 10:48 
Its easy...

First write your javascript that might change the value of a textbox, say like this:

<script>
function increaseValue(textId)
{
    var elem = document.getElementById(textId);
    if(!!elem)
        elem.value = parseInt(elem.value) + 1;
}
function decreaseValue(textId)
{
    var elem = document.getElementById(textId);
    if(!!elem)
        elem.value = parseInt(elem.value) - 1;
}
</script>


Now in your GridView.RowDataBound event write :
TextBox tb = e.Item.FindControl("tbValue") as TextBox;
Button btnIncr = e.Item.FindControl("btnIncr") as Button;
btnIncr.Attributes.Add("onclick", "javascript:increaseValue('" + tb.ClientID + "');");

Button btnDecr = e.Item.FindControl("btnDecr") as Button;
btnIncr.Attributes.Add("onclick", "javascript:decreaseValue('" + tb.ClientID + "');");



Now you see when the page is rendered it will hold the buttons with appropriate Onclick Event handlers to process the textbox tb.

Hope you like this solution. Rose | [Rose] Rose | [Rose]

Abhishek Sur

My Latest Articles
Create CLR objects in SQL Server 2005
C# Uncommon Keywords
Read/Write Excel using OleDB

Don't forget to click "Good Answer" if you like to.

GeneralRe: gridview buttons and client side scripting Pin
compninja254-Sep-09 10:50
compninja254-Sep-09 10:50 
GeneralRe: gridview buttons and client side scripting Pin
Abhishek Sur4-Sep-09 12:16
professionalAbhishek Sur4-Sep-09 12:16 
GeneralRe: gridview buttons and client side scripting Pin
compninja258-Sep-09 4:29
compninja258-Sep-09 4:29 
GeneralRe: gridview buttons and client side scripting Pin
Abhishek Sur8-Sep-09 11:59
professionalAbhishek Sur8-Sep-09 11:59 
GeneralRe: gridview buttons and client side scripting Pin
compninja259-Sep-09 11:19
compninja259-Sep-09 11:19 
GeneralRe: gridview buttons and client side scripting Pin
Abhishek Sur10-Sep-09 1:39
professionalAbhishek Sur10-Sep-09 1:39 
GeneralRe: gridview buttons and client side scripting Pin
compninja2510-Sep-09 3:51
compninja2510-Sep-09 3:51 
QuestionDocument elements have no IDs Pin
Lonnie Raffray4-Sep-09 9:04
Lonnie Raffray4-Sep-09 9:04 
AnswerRe: Document elements have no IDs Pin
Abhishek Sur4-Sep-09 10:35
professionalAbhishek Sur4-Sep-09 10:35 
GeneralRe: Document elements have no IDs Pin
Lonnie Raffray4-Sep-09 10:37
Lonnie Raffray4-Sep-09 10:37 
GeneralRe: Document elements have no IDs Pin
Abhishek Sur4-Sep-09 10:39
professionalAbhishek Sur4-Sep-09 10:39 
QuestionLink button inside the Gridview Pin
Vimalsoft(Pty) Ltd4-Sep-09 5:13
professionalVimalsoft(Pty) Ltd4-Sep-09 5:13 
AnswerRe: Link button inside the Gridview Pin
Blue_Boy4-Sep-09 6:45
Blue_Boy4-Sep-09 6:45 
GeneralRe: Link button inside the Gridview Pin
Vimalsoft(Pty) Ltd6-Sep-09 21:12
professionalVimalsoft(Pty) Ltd6-Sep-09 21:12 
AnswerRe: Link button inside the Gridview Pin
Abhijit Jana4-Sep-09 7:59
professionalAbhijit Jana4-Sep-09 7:59 
GeneralRe: Link button inside the Gridview Pin
Vimalsoft(Pty) Ltd6-Sep-09 21:13
professionalVimalsoft(Pty) Ltd6-Sep-09 21:13 
AnswerRe: Link button inside the Gridview Pin
Abhishek Sur4-Sep-09 9:02
professionalAbhishek Sur4-Sep-09 9:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.