ASP - Programar un Boton en asp

 
Vista:

Programar un Boton en asp

Publicado por Manuel (1 intervención) el 08/07/2009 20:12:40
Hola a todos, tengo un pequeño problema, les explico, tengo un wizard en el cual voy rellenando informacion en unos textbox, y al final los muestro todos en diferentes Label, y tengo un boton guardar, quisiera saber como puedo programar ese boton para que guarde en la Base de datos, o si existe alguna otra manera de hacer esto, les muestro el codigo a continuacion:

Este es el codigo donde muestro los textbox en el label, es un aspx.vb

Protected Sub Wizard1_FinishButtonClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.WizardNavigationEventArgs) Handles Wizard1.FinishButtonClick
Me.Label12.Text = txt_name.Text
Me.Label2.Text = txt_apellido.Text
Me.Label3.Text = txt_rut.Text
Me.Label5.Text = txt_fono.Text
Me.Label6.Text = txt_direc.Text
Me.Label7.Text = Dpl_genero.SelectedItem.Value
Me.Label8.Text = Dpl_edad.SelectedItem.Value
Me.Label9.Text = txt_mail.Text
Me.Label10.Text = txt_usr.Text
Me.Label11.Text = txt_pass.Text
End Sub

aqui esta el codigo que se supone que guarda los datos al momento de hacerle click en el boton.

<asp:Button ID="Button1" runat="server" Text="Button" />
<asp:SqlDataSource ID="Guardar_label" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionStringBiblioteca %> "
DeleteCommand="DELETE FROM [Usuario] WHERE [Rut] = @Rut"
InsertCommand="INSERT INTO [Usuario] ([Rut], [Nombre], [Apellido], [Telefono], [Direccion], [Edad], [genero], [Correo], [nombre_usr], [contrasena]) VALUES (@label3, @label12, @label2, @label5, @label6, @label8, @label7, @label9, @label10, @label11)"
SelectCommand="SELECT [Rut], [Nombre], [Apellido], [Telefono], [Direccion], [Edad], [genero], [Correo], [nombre_usr], [contrasena] FROM [Usuario] WHERE ([Rut] = @Rut)"
UpdateCommand="UPDATE [Usuario] SET [Nombre] = @Nombre, [Apellido] = @Apellido, [Telefono] = @Telefono, [Direccion] = @Direccion, [Edad] = @Edad, [genero] = @genero, [Correo] = @Correo, [nombre_usr] = @nombre_usr, [contrasena] = @contrasena WHERE [Rut] = @Rut">
<InsertParameters>
<asp:Parameter Name="Rut" Type="String" />
<asp:Parameter Name="Nombre" Type="String" />
<asp:Parameter Name="Apellido" Type="String" />
<asp:Parameter Name="Telefono" Type="Decimal" />
<asp:Parameter Name="Direccion" Type="String" />
<asp:Parameter Name="Edad" Type="String" />
<asp:Parameter Name="genero" Type="String" />
<asp:Parameter Name="Correo" Type="String" />
<asp:Parameter Name="nombre_usr" Type="String" />
<asp:Parameter Name="contrasena" Type="String" />
</InsertParameters>
<SelectParameters>
<asp:ControlParameter ControlID="Label3" Name="Rut" PropertyName="Text" Type="String" />
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="Nombre" Type="String" />
<asp:Parameter Name="Apellido" Type="String" />
<asp:Parameter Name="Telefono" Type="Decimal" />
<asp:Parameter Name="Direccion" Type="String" />
<asp:Parameter Name="Edad" Type="String" />
<asp:Parameter Name="genero" Type="String" />
<asp:Parameter Name="Correo" Type="String" />
<asp:Parameter Name="nombre_usr" Type="String" />
<asp:Parameter Name="contrasena" Type="String" />
<asp:Parameter Name="Rut" Type="String" />
</UpdateParameters>
<DeleteParameters>
<asp:Parameter Name="Rut" Type="String" />
</DeleteParameters>
</asp:SqlDataSource>

agradeceria mucho su ayuda.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder