IrfanRaza
IrfanRaza

Reputation: 3058

Need html code of GridView within C# code

I am having an aspx page with a user control in it. The usercontrol contains the GridView. At some place within this usercontrol i need html code of GridView.

Can anybody provide help on how i can get html code of GridView.

Thanks for sharing your time.

Upvotes: 0

Views: 1189

Answers (3)

Sameer Shemna
Sameer Shemna

Reputation: 11

i hope i am not too late for answering your question, but your problem can be solved by overriding VerifyRenderingInServerForm

you just got to paste the following code in code behind

public override void VerifyRenderingInServerForm(Control control)
{

}

Upvotes: 1

firedrawndagger
firedrawndagger

Reputation: 3733

What do you mean html code? I'm assuming you don't want to view the HTML code via your browser --> View Source (or alternatively click on the control and view source), but do some sort of extraction/editing in HTML via your code in C#? Is that correct? If so you might be able to use JQuery - but it dpeends on your requirements.

EDIT: You can also try Firebug for Firefox since that can show you client side as code that's coming in from JavaScript, CSS, etc.

Upvotes: 1

Kangkan
Kangkan

Reputation: 15571

The best source is to put a gridview into an aspx page and render it on the browser. On the browser, you can just right-click and View the source. You can copy paste and change accordingly.

Upvotes: 1

Related Questions