Click here to Skip to main content
15,888,527 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Data Binding with asp.net in vb Pin
Luc Pattyn22-May-11 16:55
sitebuilderLuc Pattyn22-May-11 16:55 
JokeRe: Data Binding with asp.net in vb Pin
Anurag Gandhi23-May-11 1:32
professionalAnurag Gandhi23-May-11 1:32 
QuestionI want to add horizontal lines center checkboxlist Pin
trinm198722-May-11 14:50
trinm198722-May-11 14:50 
AnswerRe: I want to add horizontal lines center checkboxlist Pin
trinm198722-May-11 15:49
trinm198722-May-11 15:49 
AnswerRe: I want to add horizontal lines center checkboxlist Pin
Luc Pattyn22-May-11 16:27
sitebuilderLuc Pattyn22-May-11 16:27 
GeneralRe: I want to add horizontal lines center checkboxlist Pin
Ankur\m/22-May-11 19:44
professionalAnkur\m/22-May-11 19:44 
Questionweb deployment and virtual directory snafu Pin
Super Lloyd22-May-11 5:13
Super Lloyd22-May-11 5:13 
Questionhello , please i need help about some code from article in codeproject about dynamic add and remove udercontrols Pin
Member 790462821-May-11 6:57
Member 790462821-May-11 6:57 
few weeks ago i was learning from this article

Dynamically add and remove user controls[^]

this article is great but its work with except when try to remove the user control i want to remove this part of code

public void HandleRemoveUserControl(object sender, EventArgs e)
   // 'This handles delete event fired from the user control

   {
       //'Get the user control that fired this event, and remove it
       Button but = sender as Button;
       WebUserControl DynamicUserControl = (WebUserControl)but.Parent;

       ph1.Controls.Remove(DynamicUserControl);


       /*'Keep a pipe delimited list of which user controls
       'were removed. This will increase the
       'viewstate size if the user keeps removing
       'dynamic controls, but under normal use
       'this is such a small increase in size that it shouldn't be an issue.*/

       ltlRemoved.Text += DynamicUserControl.ID + "|";
       //'Also, now that we've removed a user control decrement
       //'the count of total user controls on the page

       ltlCount.Text = (Convert.ToInt16(ltlCount.Text) - 1).ToString();
   }



this is the code in C# , but the original exercise was in VB , am idiot in VB , did i convert it wrong , and if someone can help me and tell me how we write C# code to determine wich user control fired event


this is the original one in VB

Sub HandleRemoveUserControl(ByVal sender As Object, ByVal e As EventArgs)
        'This handles delete event fired from the user control

        'Get the user control that fired this event, and remove it
        Dim DynamicUserControl As WebUserControl = sender.parent
        ph1.Controls.Remove(sender.parent)

        'Keep a pipe delimited list of which user controls 
        'were removed. This will increase the 
        'viewstate size if the user keeps removing 
        'dynamic controls, but under normal use
        'this is such a small increase in size that it shouldn't be an issue.
        ltlRemoved.Text &= DynamicUserControl.ID & "|"

        'Also, now that we've removed a user control decrement 
        'the count of total user controls on the page
        ltlCount.Text = Convert.ToInt16(ltlCount.Text) - 1
    End Sub

AnswerRe: hello , please i need help about some code from article in codeproject about dynamic add and remove udercontrols Pin
Richard MacCutchan21-May-11 8:26
mveRichard MacCutchan21-May-11 8:26 
QuestionSystem.InvalidCastException: Unable to cast object of type 'System.Decimal' to type 'System.String' Pin
Member 793283821-May-11 1:36
Member 793283821-May-11 1:36 
AnswerRe: System.InvalidCastException: Unable to cast object of type 'System.Decimal' to type 'System.String' Pin
AspDotNetDev21-May-11 1:50
protectorAspDotNetDev21-May-11 1:50 
GeneralRe: System.InvalidCastException: Unable to cast object of type 'System.Decimal' to type 'System.String' Pin
Member 793283821-May-11 2:34
Member 793283821-May-11 2:34 
GeneralRe: System.InvalidCastException: Unable to cast object of type 'System.Decimal' to type 'System.String' Pin
AspDotNetDev21-May-11 12:24
protectorAspDotNetDev21-May-11 12:24 
GeneralRe: System.InvalidCastException: Unable to cast object of type 'System.Decimal' to type 'System.String' Pin
AspDotNetDev21-May-11 12:25
protectorAspDotNetDev21-May-11 12:25 
Questiondebugging java script in asp.net Pin
vijaylumar20-May-11 20:07
vijaylumar20-May-11 20:07 
AnswerRe: debugging java script in asp.net Pin
AspDotNetDev20-May-11 21:41
protectorAspDotNetDev20-May-11 21:41 
AnswerRe: debugging java script in asp.net Pin
Ankur Sharma Dotnet22-May-11 3:15
Ankur Sharma Dotnet22-May-11 3:15 
AnswerRe: debugging java script in asp.net Pin
meeram39523-May-11 6:27
meeram39523-May-11 6:27 
QuestionVS2010 Express, no MSSQL? Pin
Helfdane20-May-11 9:28
Helfdane20-May-11 9:28 
AnswerRe: VS2010 Express, no MSSQL? Pin
AspDotNetDev20-May-11 9:51
protectorAspDotNetDev20-May-11 9:51 
GeneralRe: VS2010 Express, no MSSQL? [modified] Pin
Helfdane20-May-11 9:57
Helfdane20-May-11 9:57 
GeneralRe: VS2010 Express, no MSSQL? Pin
AspDotNetDev20-May-11 10:55
protectorAspDotNetDev20-May-11 10:55 
GeneralRe: VS2010 Express, no MSSQL? Pin
gavindon20-May-11 11:29
gavindon20-May-11 11:29 
GeneralRe: VS2010 Express, no MSSQL? Pin
Luc Pattyn20-May-11 14:52
sitebuilderLuc Pattyn20-May-11 14:52 
QuestionOverwrite Masterpage Content In Page Without Redefining Content in Sub-Masterpage Pin
AspDotNetDev20-May-11 8:25
protectorAspDotNetDev20-May-11 8:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.