45 <asp:ObjectDataSource ID="odsXxxxx" runat="server"
46 SelectMethod="GetXxxxx"
47 TypeName="Xxxxx.Xxxxx.Web.ObjectDataSource.XxxxxOds"
48 InsertMethod="InsertXxxxx0" onselecting="odsXxxxx_Selecting"
49 oninserting="odsXxxxx_Inserting" oninserted="odsXxxxx_Inserted" >
50 <InsertParameters>
51 <asp:Parameter Name="UserName" Type="String" />
52 <asp:Parameter Name="UserPassword" Type="String" />
53 <asp:Parameter Name="Email" Type="String" />
54 <asp:Parameter Name="UserId" Type="String" />
55 <asp:Parameter Direction="Output" Name="XxxxxId" Type="Int32" />
56 </InsertParameters>
57 <SelectParameters>
58 <asp:Parameter Name="XxxxxId" Type="Int32" />
59 </SelectParameters>
60 </asp:ObjectDataSource>
Code Behind: 47 protected void odsXxxxx_Inserted(object sender, ObjectDataSourceStatusEventArgs e)
48 {
49 this.XxxxxId = Convert.ToInt32(e.OutputParameters["XxxxxId"]);
50 Response.Redirect("~/User/ProfileAdd1.aspx?XxxxxId=" + this.XxxxxId.ToString() );
51 }
38 protected void odsXxxxx_Inserting(object sender, ObjectDataSourceMethodEventArgs e)
39 {
40 MembershipUser u = Membership.GetUser(this.CreateUserWizard1.UserName);
41 e.InputParameters["UserId"] = u.ProviderUserKey.ToString();
42 e.InputParameters["UserName"] = u.UserName;
43 e.InputParameters["UserPassword"] = "";
44 e.InputParameters["Email"] = u.Email;
45 }
Ods.cs file: 55 public void InsertXxxxx0(string UserName, string UserPassword, string Email, string UserId, out int XxxxxId)
56 {
57 //UserName, UserPassword, Email
58 Xxxxx t = new Xxxxx();
59 t.UserName = UserName;
60 t.Email = Email;
61 t.UserId = new Guid(UserId);
62 _service.SaveTalent(t);
63 XxxxxId = t.Id;
64 }
No comments:
Post a Comment