0

I have a page that uses site.master I am pulling into facebook by an iframe. The iframe cuts the form off width-wise. I can solve this by deleting the left hand menu.

In my site.master I have:

<table>
    <tr>
       <td class="needstogo"></td>
       <td class="keep"></td>
    </tr>
</table>

If the URL in the browser reads facebook, I need the td class="needstogo" to be hidden.

Thanks

4

1 回答 1

0

you can find and style any of the control in a child page that is inherited from master page like that:

ContentPlaceHolder cp = (ContentPlaceHolder)Master.FindControl("your site.master`s               ContentPlaceHolder name");

In your case just add the "id" attributes to your <td> tag for which you want to change the css class or want to set null. i.e.

<table>
<tr>
   <td id="test" class="needstogo"></td>
   <td class="keep"></td>
</tr>

Now in code behind just put the following two lines of code in your conditional statement:

TableRow tr = cp.FindControl("test") as TableRow;
tr.CssClass = "";

hope this will help you...

于 2013-08-08T17:26:59.840 回答