2

Basically I have a few asp.net objects. I get the ID of object 1 and assign it to a string. I then want to add a control to a placeholder than end in that ID. Not too sure how to go about doing this.

        string id = Regex.Match(btnCreateHazard.ID, @"\d+$").Value;
        phHazard(SOMEHOW GET THE ID HERE).Controls.Add(txtHazardDesc);

Thanks a lot.

1 Answer 1

1

What i understood id you want to add a string to a control that u can do like this..

 string id = Regex.Match(btnCreateHazard.ID, @"\d+$").Value;
 placeholderId.Controls.Add(id);

OR

can refer below example. https://msdn.microsoft.com/en-us/library/kyt0fzt1.aspx

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.