|
Ok..Thanks.. I will try this but can you give me some sample code, so that i can refer how to do the coding?
Best Regards,
Pei Sun
|
|
|
|
|
probably this will be helpful for you. Here complete data access in asp.net is described in detail.
http://authors.aspalliance.com/aspxtreme/adonet/index.aspx
Best Regards,
Apurva Kaushal
|
|
|
|
|
Thanks. I think this page will be very useful for me..
Best Regards,
Pei Sun
|
|
|
|
|
Best Regards,
Apurva Kaushal
|
|
|
|
|
I am posting this question third time and i will continue posting this question until i get the answer.
Sir,
I have a datagrid and problem lies into the edititemtemplate of datagrid.
I have a datagrid in the following format
--------------------------------------------------
Column1 Column2 Column2
abc1 EditImage Delete Image
abc2 EditImage Delete Image
abc3 EditImage Delete Image
-------------------------------------------------
Now when i click at the particular editimage then the control goes to the the edititemtemplate where i am using a function to construct a table in that particular row of the datagrid in which i clicked at the editimage .In the edititemtemplate i am calling a function in the following format.
------------------------------------------------
<%#LoadTable(Container.DataItem(0).ToString())%>
--------------------------------------------------
Now the table is not comming into that row but a message is being displayed in that row and the message is
System.Web.Ui.HtmlControls.HtmlTable
But i want the structure of the table instead of this message .
------------------------=---------------
I am using the following code in the LoadTable
function
----------------------------------------
Public function LoadTable(Byval str as string)as Sysytem.Web.Ui.HtmlControls.Table
dim con as new oledbconnection("connectionstring")
con.open
cmd=new oledbcommand("select * from abc where id=" & str , con)
cmd.executereader
dim dr as oledbdatareader
dr=cmd.executereader
dim t as new system.web.ui.htmlcontrol.table
dim drow as System.Web.UI.HtmlControls.HtmlTableRow
dim dcell(1) as New System.Web.UI.HtmlControls.HtmlTableCell
--------------------------------------------------------
while(dr.read)
drow = New System.Web.UI.HtmlControls.HtmlTableRow
dcell(0) = New System.Web.UI.HtmlControls.HtmlTableCell
dcell(0).Width = "30%"
dcell(1) = New System.Web.UI.HtmlControls.HtmlTableCell
dcell(1).Width = "70%"
dcell(0).InnerText = dr.Item(0)
dcell(1).InnerText = dr.Item(1)
drow.Cells.Add(dcell(0))
drow.Cells.Add(dcell(1))
t.Rows.Add(drow)
end while
----------------------------------------------------------
End Sub
please help me to construct the table in the datagrid row at edititem template of datagrid
|
|
|
|
|
amaneet wrote: I am posting this question third time and i will continue posting this question until i get the answer.
Hmmm, you are patient enough or lazy enough as you can spend your time on findind a solution instead of keeping posting this simple question.
Well, you are calling the LoadTable method in the data binding expression and the method returns an object of the HtmlTable type, so the type name of the method result object (System.Web.Ui.HtmlControls.HtmlTable) should be displayed in the web page. Here, you may have a couple of simple solutions:
+ In the LoadTable, you can render the HtmlTable object and send the output html markup as the method result.
+ In the ItemDataBound event handler of the datagrid control, you can call the LoadTable method and attach the table to the specified cell of the row.
+ Intead of building a dynamic table, you can use another datagrid in the EditItemTemplate.
|
|
|
|
|
Sir,
Can u send some code for that .Thanks for ur attention.
|
|
|
|
|
Can any one help me How to get Error message using Error No When Sql Exception is raised
|
|
|
|
|
If you want to get the error no. in sqlserver then @@Error will give you the error no.
Best Regards,
Apurva Kaushal
|
|
|
|
|
My question is when we get sql exception in Asp.net
we can obtain error number using Number property of SqlException
How to get error message at runtime using this error number
|
|
|
|
|
I'd like to output some information from a database to a datagrid on a webpage using visual basic. The program I'm using is asp.net web matrix. How do I link them? Thanx in advance.
-- modified at 0:30 Wednesday 19th July, 2006
|
|
|
|
|
|
How to move to next record in a .net as there is no option movenext in .net. please tell me some option for movenext using dataset in same page ??
-- modified at 0:18 Wednesday 19th July, 2006
|
|
|
|
|
|
I have a loop to send aysn message to different clients as below.
but even if all the clients are online and the configuration of all the clients are the same, I can only received a part of responses from clients.
Would you pls give me some suggestion about this problem?Thank you
code below------------------------------------------------------------------
foreach (IPEndPoint endPoint in this.endPoints)
{
try{
udpClient = new UdpClient();
udpClient.Connect(endPoint);
udpClient.Send(buf, length);
udpClient.BeginReceive(new AsyncCallback(ReceiveCallback), new UdpState(udpClient, endPoint));
}
catch (Exception ex){
}
----------------------------------------------------------------------------
Sincerely,
WeiYu Wang
-- modified at 18:09 Tuesday 18th July, 2006
|
|
|
|
|
Hi,
I place the adrotator control on my page.when i refresh the page the image get changed,but it's not changed automatically.
How to change the image in Adrotator automatically without refreshing the page?
Thanks in advance
|
|
|
|
|
hi
adrotator script in .NET is based on page refreshes.
In order to refresh or change the advertisement automatically, you will have to load images at page load and change tham using javascript.
Or you can use iframe and refresh that again and again .. which ever u find suitable.. and yes you can use AJAX too.
Thanks,
Sushant Duggal.
|
|
|
|
|
Hi,
I have an .aspx page. It plays a video stream using media player object. The page also got a TreeView control. The problem is that when I expand or collapse a tree node the streaming stops.
Does anyone know the reason for this or know how it can be solved?
Thanks,
A7mad
|
|
|
|
|
Are you posting back when the tree changes? If so, the whole page will be re-initialised.
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
Hi,
Can I have different collapse/expand images for a TreeView control at the same time?
I mean, for example, can one node in the tree has its expand image as a plus sign and another one has its expand image as a triangle?
I'm asking this as all I can find is that the TreeView only has one property for all expand images in the tree.
Thanks,
A7mad
|
|
|
|
|
Not unless you write a custom control to support this.
|
|
|
|
|
Hi ,
I am Ravindra.Currently doing a project in ASP.net.
I want to place rotating adds in my website.
if any body know pls help me(if possible send me the code)
Ravindra
Ravindra
|
|
|
|
|
AdRotator control need source, so add to Your project new item Xmlfile. Edit your Xmlfile, I named it file.xml :
<Advertisements>
<Ad>
<ImageUrl>images/DVD.gif</ImageUrl>
<NavigateUrl>http://www.microsoft.com</NavigateUrl>
<AlternateText>Dvd</AlternateText>
<Keyword>Computers</Keyword>
<Impressions>10</Impressions>
</Ad>
<Ad>
<ImageUrl>images/gates.gif</ImageUrl>
<NavigateUrl>http://www.microsoft.com</NavigateUrl>
<AlternateText>Young Bill</AlternateText>
<Keyword>Computers</Keyword>
<Impressions>10</Impressions>
</Ad>
<Ad>
<ImageUrl>images/java.gif</ImageUrl>
<NavigateUrl>http://www.microsoft.com</NavigateUrl>
<AlternateText>Java</AlternateText>
<Keyword>Computers</Keyword>
<Impressions>10</Impressions>
</Ad>
</Advertisements>
In your .aspx file [Source]
<asp:AdRotator ID="AdRotator1" runat="server" AdvertisementFile="~/file.xml" BorderWidth="1" />
Have fun
StonePit
-- modified at 14:30 Tuesday 18th July, 2006
|
|
|
|
|
I have to provide download from ASP.NET 2.0 web page. I have following code
objFileInfo = new FileInfo(filePath);
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=" + objFileInfo.Name);
Response.AddHeader("Content-Length", objFileInfo.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.BinaryWrite(GetFileContentsAsByteStream(filePath));
When I use this, i am able to see a popup saying OPEN/SAVE/CANCEL. If I click on SAVE, the file gets saved at selected location. If I select OPEN, it shows that it is downloading file, Then it opens respective application to open downloaded file. But at this time the application says, file not found.
Has anyone have idea what could be the reason and how can I get the file open.
Thanks in advance.
- ashish
|
|
|
|
|
Try this. In this case file must be in root of your website.
string filename = "somefile.doc";
if (filename != "")
{
string path = Server.MapPath(filename);
System.IO.FileInfo file = new System.IO.FileInfo(path);
if (file.Exists)
{
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name);
Response.AddHeader("Content-Length", file.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.WriteFile(file.FullName);
Response.End();
}
else
{
Response.Write("File does not exist!!");
}
}
StonePit
|
|
|
|