Display .htm files content in .aspx page control | Newbie | | Join Date: Aug 2009
Posts: 14
| | |
Dear sir,
I have a word document file contains text and images, now i have saved it as a web page and wants to display it on browser ,
using ,
string str=directory.getfiles("");
response.contentType="text/html";
response .writefile("");
it displayed in different format and images not shown
blank spaces shown as ?????????? and image as X.
i have no. of files stored as word file ,tried to display directly in gridview but it's not posible for me, so i converted them as web page and now i want to display 5 files dynamically in gridview including images., so help me out, looking for ur reply..
, can u tell me how it works, i will be thanxfull to u
i do not want to use web browser or process.start(" IExploreAsassr.exe","path") method because it displays only one file at a time , actually i want to dislay it in gridview item template, including pics.
| |
best answer - posted by Frinavale | Quote:
Originally Posted by shashi shekhar singh Like
frame.Attributes["src"] = getfile[i];
I am giving
frame.Attributes["src"] = "D://shekhardocuments/1.htm";
then it's not displaying , am new for iframe so plzgive me reply. Ok, that wont work, your 1.htm file has to be located on the web server. That way web browsers can down load it using the URL specified as the src attribute.
You can't use a local file path to the 1.htm file...you have to use something like "http://localhost/mywebsite/statichtm/1.htm".
So, place all of the htm files into a folder located within your project. Then loop through the directory and create the URL based on the files you find there.
So you would have something like this to create the URLs: -
string[] getfile = Directory.GetFiles(Server.MapPath("~/statichtm/"), "*.htm");
-
List<string> staticHtmUrls= new List<string>();
-
-
for (int i = 1; i < getfile.Length; i++)
-
{ string staticURL = "/statichtm/"+getfile[i];
-
staticHtmUrls.Add(staticURL );
-
}
So now you have a list of URLs to your static htm files.
I'm thinking that it will probably be easier for you to use a Repeater instead of a GridView.
So your ASP code would look like: -
<asp:Repeater ID="staticWebPagesRepeater" runat="server">
-
<HeaderTemplate>
-
<table border="1">
-
<tr>
-
<td><b>Web Pages</b></td>
-
</tr>
-
</HeaderTemplate>
-
<ItemTemplate>
-
<tr>
-
<td> <iframe src="<%# Container.DataItem %>"></iframe></td>
-
</tr>
-
</ItemTemplate>
-
<FooterTemplate>
-
</table>
-
</FooterTemplate>
-
</asp:Repeater>
And your C# code would have something like this: -
private List<string> _repSource;
-
protected void Page_Load(Object sender, System.EventArgs e)
-
{
-
_repSource = new List<string>();
-
string fileNames[] = Directory.GetFiles(Server.MapPath("~/StaticHTM/"), "*.htm");
-
foreach (string name in fileNames)
-
{
-
string sp[] = name.Split('\');
-
string urlToStaticHTML = sp(sp.Length - 1);
-
_repSource.Add("/StaticHTM/" + urlToStaticHTML );
-
}
-
staticWebPagesRepeater.DataSource = _repSource.ToArray();
-
staticWebPagesRepeater.DataBind();
-
}
-
| | Member | | Join Date: May 2009 Location: Goregaon, मुंबई IN :)
Posts: 85
| | | re: Display .htm files content in .aspx page control
well, you can use <iframe> tag - <iframe src ="myFilePath.html" width="100%" height="300">
-
<p>iframes not supported</p>
-
</iframe>
| | Member | | Join Date: May 2009 Location: Goregaon, मुंबई IN :)
Posts: 85
| | | re: Display .htm files content in .aspx page control
in response.write("") pass parameter for showing the iframe tag with the desired file...
cheers,
Nitin
|  | Member | | Join Date: Aug 2009 Location: Bengaluru, India
Posts: 119
| | | re: Display .htm files content in .aspx page control - <html>
-
<head>
-
<meta http-equiv="Content-Type" content="application/doc">
-
</head>
-
<body>
-
<iframe src="your-word-document-file.doc" width="100%" height="100%"> </iframe>
-
</body>
-
</html>
try this.
|  | Site Moderator | | Join Date: Oct 2006 Location: The Great White North
Posts: 5,066
| | | re: Display .htm files content in .aspx page control
Hi Shashi,
Have you tired viewing the HTML webpages generated by Word by themselves first?
Make sure that they display correctly before trying to use them in your asp application.
If they are working, consider using IFrames to display the webpages in the grid.
| | Newbie | | Join Date: Aug 2009
Posts: 14
| | | re: Display .htm files content in .aspx page control
i am really respectfull to u all for ur reply, i want to use like this shown as below, -
-
<div>
-
<iframe id="iframe1" runat="server" scrolling="auto" width="100%" height="100%"> </iframe>
-
-
</div>
-
string[] getfile = Directory.GetFiles(@"D:\Shekhar Documents", "*.htm");
-
for (int i = 1; i < getfile.Length; i++)
-
{
-
HtmlControl frame = (HtmlControl)this.FindControl("iframe1");
-
//string path = Server.MapPath("1.htm");
-
frame.Attributes["src"] = getfile[i];
-
}
i am using this but it not displayed my file content, it only displayed http url.. like "http://www.google.com", please help me out.. i am waiting for ur reply.
| | Member | | Join Date: May 2009 Location: Goregaon, मुंबई IN :)
Posts: 85
| | | re: Display .htm files content in .aspx page control
try displaying only single file on the page @shashi shekhar singh
| | Newbie | | Join Date: Aug 2009
Posts: 14
| | | re: Display .htm files content in .aspx page control
Like
frame.Attributes["src"] = getfile[i];
I am giving
frame.Attributes["src"] = "D://shekhardocuments/1.htm";
then it's not displaying , am new for iframe so plzgive me reply.
| | Member | | Join Date: May 2009 Location: Goregaon, मुंबई IN :)
Posts: 85
| | | re: Display .htm files content in .aspx page control Quote:
Originally Posted by shashi shekhar singh frame.Attributes["src"] = "D://shekhardocuments/1.htm"; The src attribute should be internet url e.g. http://localhost/shekhardocuments/1.htm
and also you should add the html files in the project directory..
|  | Site Moderator | | Join Date: Oct 2006 Location: The Great White North
Posts: 5,066
| | | re: Display .htm files content in .aspx page control Quote:
Originally Posted by shashi shekhar singh Like
frame.Attributes["src"] = getfile[i];
I am giving
frame.Attributes["src"] = "D://shekhardocuments/1.htm";
then it's not displaying , am new for iframe so plzgive me reply. Ok, that wont work, your 1.htm file has to be located on the web server. That way web browsers can down load it using the URL specified as the src attribute.
You can't use a local file path to the 1.htm file...you have to use something like "http://localhost/mywebsite/statichtm/1.htm".
So, place all of the htm files into a folder located within your project. Then loop through the directory and create the URL based on the files you find there.
So you would have something like this to create the URLs: -
string[] getfile = Directory.GetFiles(Server.MapPath("~/statichtm/"), "*.htm");
-
List<string> staticHtmUrls= new List<string>();
-
-
for (int i = 1; i < getfile.Length; i++)
-
{ string staticURL = "/statichtm/"+getfile[i];
-
staticHtmUrls.Add(staticURL );
-
}
So now you have a list of URLs to your static htm files.
I'm thinking that it will probably be easier for you to use a Repeater instead of a GridView.
So your ASP code would look like: -
<asp:Repeater ID="staticWebPagesRepeater" runat="server">
-
<HeaderTemplate>
-
<table border="1">
-
<tr>
-
<td><b>Web Pages</b></td>
-
</tr>
-
</HeaderTemplate>
-
<ItemTemplate>
-
<tr>
-
<td> <iframe src="<%# Container.DataItem %>"></iframe></td>
-
</tr>
-
</ItemTemplate>
-
<FooterTemplate>
-
</table>
-
</FooterTemplate>
-
</asp:Repeater>
And your C# code would have something like this: -
private List<string> _repSource;
-
protected void Page_Load(Object sender, System.EventArgs e)
-
{
-
_repSource = new List<string>();
-
string fileNames[] = Directory.GetFiles(Server.MapPath("~/StaticHTM/"), "*.htm");
-
foreach (string name in fileNames)
-
{
-
string sp[] = name.Split('\');
-
string urlToStaticHTML = sp(sp.Length - 1);
-
_repSource.Add("/StaticHTM/" + urlToStaticHTML );
-
}
-
staticWebPagesRepeater.DataSource = _repSource.ToArray();
-
staticWebPagesRepeater.DataBind();
-
}
-
| | Newbie | | Join Date: Aug 2009
Posts: 14
| | | re: Display .htm files content in .aspx page control
Respected Sir @Frinavale
I have used as u have explained by using repeater with iframe and the url , but i am geting error ...
C# Code: -
//string[] getfile = Directory.GetFiles(Server.MapPath("~/statichtm/"), "*.htm");
-
string[] getfile = Directory.GetFiles(@"D:\Shekhar Documents\Tutorial + Development\html\Question_Html","*.htm");
-
List<string> staticHtmUrls = new List<string>();
-
-
for (int i = 1; i < getfile.Length; i++)
-
{
-
string staticURL = "/statichtm/" + getfile[i];
-
staticHtmUrls.Add(staticURL);
-
}
-
staticWebPagesRepeater.DataSource = staticHtmUrls.ToArray();
-
staticWebPagesRepeater.DataBind();
-
--------------------------------------------------------------------------------
-------------------------------------------------------------------------------- -
<asp:Repeater ID="staticWebPagesRepeater" runat="server">
-
<HeaderTemplate>
-
<table border="1">
-
<tr>
-
<td><b>Web Pages</b></td>
-
</tr>
-
</HeaderTemplate>
-
<ItemTemplate>
-
<tr>
-
<td> <iframe src="<%# Container.DataItem %></td>"></iframe></td>
-
</tr>
-
</ItemTemplate>
-
<FooterTemplate>
-
</table>
-
</FooterTemplate>
-
</asp:Repeater>
-
-
</div>
Error is:
Server Error in '/bytes' Application.
--------------------------------------------------------------------------------
HTTP Error 400 - Bad Request.
--------------------------------------------------------------------------------
Version Information: ASP.NET Development Server 9.0.0.0
one thing that i forgot to explain to you. My original source file was of word Document type(MS word 2007) (text + image), i converted them in to .htm file, so when i add all files(.htm+image folders) into Visual Studio Solution Explorer and open to view in browser the error is:
Server Error in '/bytes' Application.
--------------------------------------------------------------------------------
HTTP Error 403 - Forbidden.
--------------------------------------------------------------------------------
Version Information: ASP.NET Development Server 9.0.0.0
looking for your reply it's urgent for me..
|  | Site Moderator | | Join Date: Oct 2006 Location: The Great White North
Posts: 5,066
| | | re: Display .htm files content in .aspx page control
Well there are a couple of reasons why this wont work.
I didn't fully test the code because I was just quickly giving you an example and thought that you'd be able to figure it out from there. I work mainly in VB.NET and so I didn't test the loop that you had in your code already...needless to say I did not test the code, it was just an example.
The first problem with the code I posted is that I accidentally left a "<td>" in the src attribute in the ASP code....the ASP code should be: - <asp:Repeater ID="staticWebPagesRepeater" runat="server">
-
<HeaderTemplate>
-
<table border="1">
-
<tr>
-
<td><b>Web Pages</b></td>
-
</tr>
-
</HeaderTemplate>
-
<ItemTemplate>
-
<tr>
-
<td> <iframe src="<%# Container.DataItem %>"></iframe></td>
-
</tr>
-
</ItemTemplate>
-
<FooterTemplate>
-
</table>
-
</FooterTemplate>
-
</asp:Repeater>
The second thing that is wrong with this code is that when you use the Directory.GetFiles() method it returns you a list of Path And File Names that match the pattern you're searching for.
We stated earlier that you cannot have a local path to a file because the web browser will not be able to download it...web browsers cannot access local files on your computer, it can only access files that exist on the web server and can only do so using a URL. You need to create a URL using the file name.
Because we simply prepended the "/statichtm/" to the file name, and didn't properly extract the name of the file from the Path/FileName your Urls are going to look like:
"/statichtm/D:\PatToVisualStudioProject\1.htm"
Obviously this is not a valid URL....what you really want is just:
"/statichtm/1.htm"
This would have been very obvious if you had used the debugger and stepped through the code.
So what you need to do is fix the ASP code so that the "<td>" is not part of the iframe's src attribute, and modify your loop so that it extracts the file name and then properly create the URLs by prepending "/statichtm/" to the file name extracted.
This is the working VB.NET version of what your code should look like. - Private _repSource As List(Of String)
-
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
-
_repSource = New List(Of String)
-
Dim fileNames() As String = Directory.GetFiles(Server.MapPath("~/StaticHTM/"), "*.htm")
-
For Each name In fileNames
-
Dim sp() As String = name.Split("\"c)
-
Dim urlToStaticHTML As String = sp(sp.Length - 1)
-
_repSource.Add("/StaticHTM/" + urlToStaticHTML)
-
Next
-
staticWebPagesRepeater.DataSource = _repSource.ToArray
-
staticWebPagesRepeater.DataBind()
-
End Sub
-
C# would look something like (the following is obviously not tested): - private List<string> _repSource;
-
protected void Page_Load(Object sender, System.EventArgs e)
-
{
-
_repSource = new List<string>();
-
string fileNames[] = Directory.GetFiles(Server.MapPath("~/StaticHTM/"), "*.htm");
-
foreach (string name in fileNames)
-
{
-
string sp[] = name.Split('\');
-
string urlToStaticHTML = sp(sp.Length - 1);
-
_repSource.Add("/StaticHTM/" + urlToStaticHTML );
-
}
-
staticWebPagesRepeater.DataSource = _repSource.ToArray();
-
staticWebPagesRepeater.DataBind();
-
}
In the future, please try to debug the problem before automatically asking for help.
| | Newbie | | Join Date: Aug 2009
Posts: 14
| | | re: Display .htm files content in .aspx page control Quote:
Originally Posted by Frinavale Well there are a couple of reasons why this wont work.
I didn't fully test the code because I was just quickly giving you an example and thought that you'd be able to figure it out from there. I work mainly in VB.NET and so I didn't test the loop that you had in your code already...needless to say I did not test the code, it was just an example.
The first problem with the code I posted is that I accidentally left a "<td>" in the src attribute in the ASP code....the ASP code should be: - <asp:Repeater ID="staticWebPagesRepeater" runat="server">
-
<HeaderTemplate>
-
<table border="1">
-
<tr>
-
<td><b>Web Pages</b></td>
-
</tr>
-
</HeaderTemplate>
-
<ItemTemplate>
-
<tr>
-
<td> <iframe src="<%# Container.DataItem %>"></iframe></td>
-
</tr>
-
</ItemTemplate>
-
<FooterTemplate>
-
</table>
-
</FooterTemplate>
-
</asp:Repeater>
The second thing that is wrong with this code is that when you use the Directory.GetFiles() method it returns you a list of Path And File Names that match the pattern you're searching for.
We stated earlier that you cannot have a local path to a file because the web browser will not be able to download it...web browsers cannot access local files on your computer, it can only access files that exist on the web server and can only do so using a URL. You need to create a URL using the file name.
Because we simply prepended the "/statichtm/" to the file name, and didn't properly extract the name of the file from the Path/FileName your Urls are going to look like:
"/statichtm/D:\PatToVisualStudioProject\1.htm"
Obviously this is not a valid URL....what you really want is just:
"/statichtm/1.htm"
This would have been very obvious if you had used the debugger and stepped through the code.
So what you need to do is fix the ASP code so that the "<td>" is not part of the iframe's src attribute, and modify your loop so that it extracts the file name and then properly create the URLs by prepending "/statichtm/" to the file name extracted.
This is the working VB.NET version of what your code should look like. - Private _repSource As List(Of String)
-
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
-
_repSource = New List(Of String)
-
Dim fileNames() As String = Directory.GetFiles(Server.MapPath("~/StaticHTM/"), "*.htm")
-
For Each name In fileNames
-
Dim sp() As String = name.Split("\"c)
-
Dim urlToStaticHTML As String = sp(sp.Length - 1)
-
_repSource.Add("/StaticHTM/" + urlToStaticHTML)
-
Next
-
staticWebPagesRepeater.DataSource = _repSource.ToArray
-
staticWebPagesRepeater.DataBind()
-
End Sub
-
C# would look something like (the following is obviously not tested): - private List<string> _repSource;
-
protected void Page_Load(Object sender, System.EventArgs e)
-
{
-
_repSource = new List<string>();
-
string fileNames[] = Directory.GetFiles(Server.MapPath("~/StaticHTM/"), "*.htm");
-
foreach (string name in fileNames)
-
{
-
string sp[] = name.Split('\');
-
string urlToStaticHTML = sp(sp.Length - 1);
-
_repSource.Add("/StaticHTM/" + urlToStaticHTML );
-
}
-
staticWebPagesRepeater.DataSource = _repSource.ToArray();
-
staticWebPagesRepeater.DataBind();
-
}
In the future, please try to debug the problem before automatically asking for help.
Thank you very much Sir,
I have gotted what i had to do.
thanks a lot again....
u have given a nice answer and made a nice conversetion to me. i really respect u..
bye.. have a nice day
| | Newbie | | Join Date: Aug 2009
Posts: 14
| | | re: Display .htm files content in .aspx page control
Respected Sir,
thanx a lot for your help now i am facing some other problem . Now i have to display these selected files into gridview/repeater 5 files per page and want to make a custom next and previous button so that when user click next button it's selected radio button item inserted into database and next remaining files will be displayed on the gridview/ repeater template.
Looking for ur reply..
|  | Site Moderator | | Join Date: Oct 2006 Location: The Great White North
Posts: 5,066
| | | re: Display .htm files content in .aspx page control
Hi Shashi,
Please take the time to research the problem before you post your question. The experts here are more than willing to help you with a specific problem but you have to do your part to learn the basics.
Once you've tried to solve the problem and you need some help, ask for help on your specific problem.
| | Newbie | | Join Date: Aug 2009
Posts: 14
| | | re: Display .htm files content in .aspx page control Quote:
Originally Posted by Frinavale Hi Shashi,
Please take the time to research the problem before you post your question. The experts here are more than willing to help you with a specific problem but you have to do your part to learn the basics.
Once you've tried to solve the problem and you need some help, ask for help on your specific problem. Respected Sir....
i have a gridview inside them a radiobuttonlist taken by me. -
<asp:GridView ID="QuestionView1" runat="server" AutoGenerateColumns="False"
-
Width="262px" PageSize="3" AllowPaging="True">
-
<PagerSettings NextPageText="" PreviousPageText="" Visible="False" />
-
<Columns>
-
<asp:TemplateField HeaderText="Questions">
-
<ItemTemplate>
-
<tr>
-
<td> <iframe src="<%# Container.DataItem %>" height="450" width="800"></iframe></td>
-
</tr>
-
<tr>
-
<td align="center" bgcolor="Yellow">
-
<asp:RadioButtonList ID="Answerlist" runat="server" RepeatDirection="Horizontal" ID="radiolist" Font-Bold="True" ForeColor="#0099FF" TextAlign="Left">
-
<asp:ListItem Value="001" Text="Answer 1" ></asp:ListItem>
-
<asp:ListItem Value="002" Text="Answer 2"></asp:ListItem>
-
<asp:ListItem Value="003" Text="Answer 3"></asp:ListItem>
-
<asp:ListItem Value="004" Text="Answer 4"></asp:ListItem>
-
-
</asp:RadioButtonList>
-
</td>
-
-
</tr>
-
</ItemTemplate>
-
-
-
</asp:TemplateField>
-
</Columns>
-
-
</asp:GridView>
but when itry to findout whic radio button has been clicked it shows error, i am really tired . -
RadioButtonList rdo = (RadioButtonList)QuestionView1.Rows[0].FindControl("Answerlist");
-
Response.Write("value has been selected" + rdo.SelectedValue + "<br/>");
looking for your reply....
From Shashi shekhar singh
|  | Site Moderator | | Join Date: Oct 2006 Location: The Great White North
Posts: 5,066
| | | re: Display .htm files content in .aspx page control
Hmmm,
What you've posted looks fine...what is the error?
Are you calling the DataBind method for the GridView somewhere near the beginning of the ASP page life cycle (like in the Page Load event)?
-Frinny
PS. I'm not a Sir ;)
| | Newbie | | Join Date: Aug 2009
Posts: 14
| | | re: Display .htm files content in .aspx page control Quote:
Originally Posted by Frinavale Hmmm,
What you've posted looks fine...what is the error?
Are you calling the DataBind method for the GridView somewhere near the beginning of the ASP page life cycle (like in the Page Load event)?
-Frinny
PS. I'm not a Sir ;) yes sir..
i bind the gridview on page _load and different button click of page like next ,previous, first and last button...
help me out looking for your reply..
|  | Site Moderator | | Join Date: Oct 2006 Location: The Great White North
Posts: 5,066
| | | re: Display .htm files content in .aspx page control
Move the databind to the PreRender event instead.
| | Newbie | | Join Date: Aug 2009
Posts: 14
| | | re: Display .htm files content in .aspx page control Quote:
Originally Posted by Frinavale Move the databind to the PreRender event instead. thank you very much sir, i have got it..that i needed.
| | Newbie | | Join Date: Aug 2009
Posts: 14
| | | re: Display .htm files content in .aspx page control
Respected Sir,
thanx a lot for your support with me.
This time I have a gridview with multiple button controls inside gridview item template.now i have to check it, out side of the gridview button click event to know which button has been clicked. i am sending my .aspx page plz check it and help me out..
as shown above i want to check it which button has been clicked on -
Button21_Click(object sender, eventargs e)
-
{
-
-
}
plz help me out..waiting for your reply..
|  | Site Moderator | | Join Date: Oct 2006 Location: The Great White North
Posts: 5,066
| | | re: Display .htm files content in .aspx page control
This one's a bit tricky.
The only time I've really done something like this I was using dynamic columns and dynamic TemplateFields. The code I implemented for the TemplateField would handle the onclick event and then raise it again so that the page code could handle it.
My guess would be that you'll have to use the GridView.RowCommand event. Remember that the first parameter is the Object that raised the event (which could be your button, but could be something else too)
-Frinny
| | Newbie | | Join Date: Aug 2009
Posts: 14
| | | re: Display .htm files content in .aspx page control Quote:
Originally Posted by Frinavale This one's a bit tricky.
The only time I've really done something like this I was using dynamic columns and dynamic TemplateFields. The code I implemented for the TemplateField would handle the onclick event and then raise it again so that the page code could handle it.
My guess would be that you'll have to use the GridView.RowCommand event. Remember that the first parameter is the Object that raised the event (which could be your button, but could be something else too)
-Frinny When Button out side of the gridview has been clicked then how to determine which button raises the event to to give the source of iframe. ok if i found them by giving the condition
on submit button click... -
if(gridview1.pageindex==0 && btn.text="1")
-
{
-
btn1.enabled =false;
-
}
then it is true only for one postback when next button inside the gridview clicked then it's enabled property =true.
i want to do when submit button clicked then the buutton inside the gridview who raises the src to iframe should be disabled for application lifetime.
Is it possible plz tel me how..it will be possible.
and also tell me how to raise the row_command event in gridview -
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
-
AllowPaging="True" Height="197px" PageSize="1" Width="406px"
-
onrowcommand="GridView1_RowCommand">
-
<PagerSettings Visible="False" />
-
<Columns>
-
<asp:TemplateField HeaderText="Select Questions">
-
<ItemTemplate>
-
</ItemTemplate>
-
void GridView1_RowCommand(objectsender,GridViewCommandEventArgs e)
-
{
-
foreach (GridViewRow row in GridView1.Rows)
-
{
-
Button one = row.FindControl("Button1") as Button;
-
Button two = row.FindControl("Button2") as Button;
-
Button three = row.FindControl("Button3") as Button;
-
Button four = row.FindControl("Button4") as Button;
-
Button five = row.FindControl("Button5") as Button;
-
Button six = row.FindControl("Button6") as Button;
-
Button seven = row.FindControl("Button7") as Button;
-
Button eight = row.FindControl("Button8") as Button;
-
Button nine = row.FindControl("Button9") as Button;
-
Button ten = row.FindControl("Button10") as Button;
-
Button eleven = row.FindControl("Button11") as Button;
-
Button twelve = row.FindControl("Button12") as Button;
-
Button thirteen = row.FindControl("Button13") as Button;
-
Button fourteen = row.FindControl("Button14") as Button;
-
if (GridView1.PageIndex == 0 && one.Text == "1")
-
{
-
one.Enabled = false;
-
-
}
-
if (GridView1.PageIndex == 1 && two.Text == "2")
-
{
-
two.Enabled = false;
-
-
}
-
if (GridView1.PageIndex == 2 && three.Text == "3")
-
-
{
-
three.Enabled = false;
-
-
}
-
string name = e.CommandName;
-
switch (e.CommandName)
-
{
-
case "1":
-
one.Enabled = false;
-
break;
-
case "2":
-
two.Enabled = false;
-
break;
-
-
}
-
}
|  | Site Moderator | | Join Date: Oct 2006 Location: The Great White North
Posts: 5,066
| | | re: Display .htm files content in .aspx page control
I should have looked at your code more closely.
I though you were using CommandField buttons not actual Buttons.
Please look into seeing if CommandField controls could be any help to you.
|  | | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,272 network members.
|