Question about client side and code behind code

How is code behind code processed on client side?

I ask because I'm trying to figure out a problem I have with a link button in a gridview. If I open the page and run it as normal everything fires fine. I click on the link button and it loads the new page. However if I email the page to myself and click on the link button nothing happens. I do not think that the Gridview_Rowcommand fires.

The link button represents a DB ID field and all the code is in the GridView_RowCommand event in the code behind and fires a Server.Transfer at the end to load the new page. I have tried Response.Redirect but it does not matter because the code behind never fires.

 Thoughts would be appreciated.


8/26/2008 5:15:37 PM 24353 articles. 2 followers. Follow

2 Replies

Similar Articles

[PageSpeed] 50
Get it on Google Play
Get it on Apple App Store

Code behind and client side code are two completely seperate things. Everything in the code behind executes on the server during postbacks, client side code (i.e. javascript) executes in the browser in between postbacks. 

I highly recommend a beginners book to, as it seems you need a bit of work  on the fundamental concepts behind server side scripting in general.

Please remember to Mark As Answered if this post has answered your question
8/27/2008 4:38:27 AM


However if I email the page to myself and click on the link button nothing happens.

so this implies that the page is also sent to you as email?

code behind are the server-side logic of your web application, hence when you click on the link button from your webpage;
it can process the page's code behind hence executing the logic behind it, which in this case... within your
Gridview_Rowcommand you may have a Respose.Redirect() logic hence linking to another page.
the code-behind's are executed within your web application...

but if what i undertand is that, you also have this page send to you as email; the code behind's logic may no longer be executed since what you would be having may be the HTML page. hence, when you clicked, nothing happened...

you might want to opt to setup a hyperlink column, where you add querystring parameters on it...

<asp:Gridview id="Gridview 2" style="Z-INDEX: 102; LEFT: 416px; POSITION: absolute; TOP: 56px"
runat="server" AutoGenerateColumns="False">
<asp:HyperLinkColumn Target="_blank" DataNavigateUrlField="[ColumnField]" DataNavigateUrlFormatString="[LinkASPXPage]?id={0}"
</asp:Gridview >

 [ColumnField]   = field column, in you case may be the DB ID field as stated...
 [LinkASPXPage]  = page where the link redirects to...

Clicking “Mark as Answer” would also help other community members reading the thread.

"Two roads diverged in a wood, and I—; I took the one less traveled by, And that has made all the difference. -The Road Not Taken"
8/27/2008 7:00:44 AM

Web resources about - Question about client side and code behind code -

German question - Wikipedia, the free encyclopedia
"Kleindeutschland" redirects here. For the neighborhood in New York City, see Little Germany, Manhattan . 1820 map of Central Europe showing ...

Half-Life 1 & 2 writer answers fan’s HL3 question by announcing retirement
Marc Laidlaw helped write these Half-Life characters into existence; should they return to video games, it won't be under his guidance. (credit: ...

Submit your questions for Autoblog Podcast #461
Filed under: Podcasts On Episode #461 of the Autoblog Podcast, we'll discuss the flood of automotive news from the 2016 Consumer Electronics ...

One SAHM's Answer to the Dreaded Question: 'Do You Work?'
We volunteer at school (but not too much). We get involved with sports (but not too much). We show up at every poetry reading, tipi-making event, ...

Cruz: McCain Questions Citizenship Because He Secretly Backs Rubio
The Texas senator's rebuttal comes after McCain said during a Phoenix radio interview that Cruz's birth abroad and his eligibility to become ...

The question this AOL exec asked herself that caused her to make a major resolution this year
AOL chief marketing officer Allie Kline says that the inspiration for one of her 2016 New Year's resolutions hit her in a meeting with a handful ...

Question #4 for 2016: Will the core inflation rate rise in 2016? Will too much inflation be a concern ...
Earlier I posted some questions for next year: Ten Economic Questions for 2016 . I'll try to add some thoughts, and maybe some predictions for ...

Trump doubles down on Cruz's birthplace questions - Videos - CBS News
Insults are flying in the Republican race for the White House. Even while taking a day off the campaign trail, Donald Trump continued to question ...

Energy experts question oil's bottom
It's been quite the ride for the markets in the first week of trading this new year, but where is this wild ride taking oil?

Bill Clinton Avoids Reporter’s Question About Reemergence Of Juanita Broaddrick
Bill Clinton Avoids Reporter’s Question About Reemergence Of Juanita Broaddrick

Resources last updated: 1/9/2016 1:29:04 AM