Submit and Postback

Please install Silverlight or click download to watch video locally.

This video will introduce you the what goes on "under the covers" when your ASP.NET application’s browser and server interact.

Presented by Joe Stagner

Duration: 19 minutes, 24 seconds

Date: 20 April 2009

Watch    Video   |   Download    Video

Video downloads: WMV  |  Zune  |  iPod  |  PSP  |  MPEG-4  |  3GP

Audio downloads: AAC  |  WMA  |  MPEG-4  |  MPEG-3  |  MPEG-2

Comments : 17

Leave a Comment

abinashbishoyi : On April 21, 2009 1:49 AM said:

I always wait for you, Joe. Thanks.

rogerric9 : On April 21, 2009 2:04 PM said:

Thanks, Joe. Very informative.

abelanet : On April 21, 2009 9:18 PM said:

Cool thanks

Sayre : On April 22, 2009 2:31 AM said:

Nice Video Joe.

Thanks

Sayre : On April 22, 2009 2:33 AM said:

Nice Video Joe.

Thanks

Manoj1906 : On April 24, 2009 7:51 PM said:

Educative

JoeStagner : On April 27, 2009 2:35 PM said:

:) Thanks Guys !!!!

amrosh : On May 18, 2009 8:54 AM said:

nice Work..

amrosh : On May 18, 2009 8:55 AM said:

Nice work Man

TomNuff : On May 19, 2009 9:10 PM said:

I had a question. In Visual Studio 2008 i have created an asp website. I'm creating a drop down list and want to submit the value of the drop down list back to an SQL DB. I created a simple form that has one button and one drop down list as a test go ensure I can write.

I've been having the hardest time posting back to the server. I keep getting an error after I hit the button that says

"InvalidCastException was unhandled by user code"

Unable to Cast object of type

'System.Web.UI.WebControls.SqlDataSourceCommandEventArgs' to type

'System.Web.UI.WebControls.SqlDataSourceSelectingEventArgs'.

This is the code for my .aspx.vb

---------------------------------

Partial Class _Default

Inherits System.Web.UI.Page

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

formresults.Insert()

End Sub

Protected Sub SqlDataSource1_Inserting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceSelectingEventArgs) Handles formresults.Inserting

e.Command.Parameters("@ContactType").Value = ContactType.Text

End Sub

End Class

----------------------

This is the code for my .aspx page

------------------------------

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "" target="_blank">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

" target="_blank">http://www.w3.org/1999/xhtml">

Untitled Page

Choose Contact Type

Email

Phone

Fax

In Person

Social Meeting

Other

ConnectionString="<%$ ConnectionStrings:SSAContactLogConnectionString %>"

InsertCommand="StoredProcedure4"

InsertCommandType="StoredProcedure"

SelectCommand="SELECT * FROM [TestTable]">

</asp:SqlDataSource>

<asp:Button ID="Button1" runat="server" Text="Submit" />

</form>

</body>

</html>

Any help would be appreciated.

Thanks,

dave14feb : On July 01, 2009 6:43 AM said:

Where I can find more videos from you, Joe?

2177 : On July 16, 2009 11:08 PM said:

2 years ago, i was novice to asp.net. thanks to joe, now i am asp.net developer !

velpuri : On July 17, 2009 9:09 AM said:

Really nice work joe

Many Thanks,

hakkibilgehan : On August 18, 2009 11:26 PM said:

joe's super man

jpete17 : On October 01, 2009 1:40 PM said:

great videos for touching up any misunderstandings

anirudha gupta : On November 05, 2009 11:29 AM said:

i try to download it but i can't do it . this is not bandwidth or broadband problem. i already have a good connection how i can download this video because i see in browser then i waste our time so i need it's hard copy for watch it

tmorton : On November 05, 2009 7:58 PM said:

@anirudha gupta: Click on the Download Video link above to download the video in ZIP format (http://download.microsoft.com/download/9/1/E/91E4FC07-38B4-4B7D-A494-38DE062FB880/winvideo-VWD-07-Submit_and_Postbackl.zip) I just tried it, and it worked successfully. If it's not working from you, there is an issue between your computer and the server...perhaps a corporate policy or something else.

Leave a Comment

You must be logged in to leave a comment. Click here to log in.

Microsoft Communities