MMC Snapin c#

A

auad

Hi,

I wolud like to know if there is a way to load or embed a mmc snapin
(like sql server, iis,...) in a windows application. I would like to
display on my Form.

Tks,
 
G

Guest

I don't understand what's going on here.

So in asp.net I have something like this below (vb version):
'---------------------- this part is in the partial page class

Protected Sub snTBx_Load(ByVal sender As Object, ByVal e As
System.EventArgs)
sender.Text = Me.MakeRandom()
End Sub

'---------------------- (the asp page)


<asp:FormView ID="FormView1" CssClass="signuptable" runat="server"
DataKeyNames="ID" DataSourceID="SqlDSource"
OnPageIndexChanging="FormView1_PageIndexChanging"
OnInserting="FormView1_ItemInserting" DefaultMode="Insert"
Width="288px" Height="251px" CellPadding="10">
<InsertItemTemplate>
<span class="signuplabel">name:</span><br />
<asp:TextBox ID="nTBx" runat="server" Text='<%#
Bind("name") %>' Width="250px"
AutoCompleteType="FirstName"></asp:TextBox><br />
<span class="signuplabel">email:</span><br />
<asp:TextBox ID="eTBx" runat="server" Text='<%#
Bind("email") %>' Width="250px"
AutoCompleteType="Email"></asp:TextBox><br />
<asp:TextBox ID="snTBx" runat="server" Text='<%#
Bind("srnumbr") %>' Visible="False" Height="0px"
OnLoad="snTBx_Load"></asp:TextBox><br />
<asp:Button ID="InsertButton" runat="server"
CausesValidation="true" CommandName="Select" Text="Sign me up"
UseSubmitBehavior="false" OnClick="InsertButton_Click" />
</InsertItemTemplate>
</asp:FormView>

So I decided to convert that to c#. Everything started working well
until the sender. Anyhow this is how the above converts over to c#

//---------------------- the partial page class
protected void snTBx_Load(object sender, EventArgs e){
sender.Text = this.MakeRandom();
}


//---------------------- (the asp page)

<asp:FormView ID="FormView1" CssClass="signuptable" runat="server"
DataKeyNames="ID" DataSourceID="SqlDSource" DefaultMode="Insert"
Width="288px" Height="251px" CellPadding="10">
<InsertItemTemplate>
<span class="signuplabel">name:</span><br />
<asp:TextBox ID="nTBx" runat="server" Text='<%#
Bind("name") %>' Width="250px"
AutoCompleteType="FirstName"></asp:TextBox><br />
<span class="signuplabel">email:</span><br />
<asp:TextBox ID="eTBx" runat="server" Text='<%#
Bind("email") %>' Width="250px"
AutoCompleteType="Email"></asp:TextBox> <br />
<asp:TextBox ID="snTBx" runat="server" Text='<%#
Bind("srnumbr") %>' Visible="true" Height="10px"
OnLoad="snTBx_Load">sadfasdfsa</asp:TextBox><br />
<asp:Button ID="InsertButton" runat="server"
CausesValidation="true" CommandName="Select" Text="Sign me up"
UseSubmitBehavior="false" OnClick="InsertButton_Click" />
</InsertItemTemplate>
</asp:FormView>


Again it seems that the sender doesn't allow for the text property,
so I thought I could try to page load the information, but I can't
seem to reference it through intellisense. How do you get the items
in the insertitemtemplate?

Thanks in advance for all your help,

Kelly
 
G

Guest

Ok I found out that you have to do something like this to get the items inside:

textbox spectxt = formview1.FindControl("atextboxItem")

Just sending this on incase if someone else had a similar issue


Warmly,

Kelly
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top