|
Hi Mark,
Thanks for the reply.
I've tried accessing "Contact2" and "cphMainContent", which are the Content ID and ContentPlaceHolderID in the related aspx.cs file, but I recieve the error message:
The name 'cphMainContent' does not exist in the current context
How would I go about accessing the PlaceHolder though the Master page?
Thanks,
Mel
|
|
|
|
|
|
This happened because you are loading controls inside the
placeholder at runtime
So it may find placeholder null until you load any control inside it.
However, not sure about it.
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
Hi All,
I am generating HTML kind of file through code behind. using the following code.
<code>
sb is a string builder
sb.Append("<table border ='0'>");
sb.Append("<tr>");
sb.Append("<td>");
sb.Append("Org Name :");
sb.Append("</td>");
sb.Append("<td>");
sb.Append(Session["orgName"].ToString());
sb.Append("</td>");
sb.Append("</tr>");
sb.Append("<tr>");
sb.Append("<td>");
sb.Append("Start Date :");
sb.Append("</td>");
sb.Append("<td>");
sb.Append(Session["startDate"].ToString());
sb.Append("</td>");
sb.Append("</tr>");
sb.Append("<tr>");
sb.Append("<td>");
sb.Append("End Date :");
sb.Append("</td>");
sb.Append("<td>");
sb.Append(Session["toDate"].ToString());
sb.Append("</td>");
sb.Append("</tr>");
sb.Append("</table>");
sb.Append("<table border ='1'>");
sb.Append("<tr width ='100%'>");
sb.Append("<td width ='15%'>");
sb.Append("SN");
sb.Append("</td>");
sb.Append("<td width ='15%'>");
sb.Append("Patient Id");
sb.Append("</td>");
sb.Append("<td width ='15%'>");
sb.Append("Requested Time");
sb.Append("</td>");
sb.Append("<td width ='15%'>");
sb.Append("Completed Time");
sb.Append("</td>");
sb.Append("<td width ='15%'>");
sb.Append("Study Type");
sb.Append("</td>");
sb.Append("<td width ='15%'>");
sb.Append("Amount");
sb.Append("</td>");
sb.Append("<td width ='15%'>");
sb.Append("Applied Plan");
sb.Append("</td>");
sb.Append("</tr>");
sb.Append("</table>");
below this one accept button will come
<asp:Button ID ="btnAccept" Text ="Accept" runat ="server" onclick="btnAccept_Click" />
but when i am writing this using Response.write(sb.tostring()); to the page
Data is coming is in proper format but the button is coming above html data how to fix this.
</code>
thanks and regards,
Amit Patel
|
|
|
|
|
So why are you generating the table like this but using a server control for the button? You can use a DataList or Reperator or DataGrid.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Amit Patel1985 wrote: Response.write(sb.tostring());
Response.Write executes after the Page Render, that is your button is already rendered in the UI. So, the table will be placed below the Button only. Place a Label or Literal above the Button and set the Text to the sb.ToString().
|
|
|
|
|
Thanks Castle u solved my problem
|
|
|
|
|
Hi
Please can anyone help me to provide link or code to implement rating control in asp.net.
requirement:
while putting rating, on mouse over, stars should be highlighted and can recognized value of clicked star.
while displaying star should be highlighted as per average rating, I mean to say that last star might be highlighted 1/2 or 3/4 or ... as per average rating.
like:average rating is 3.5 means 3 stars full and 4th star half will be highlighted.
Thank
You get the best out of others when you give the best of yourself.
|
|
|
|
|
|
Hi,
I am saving pdf file into database reading from memroystream and it is saving properly, but when i try to retreive it it is throwing an error message "ile is damaged and could not be repaired".
I am using itextsharp to generate the PDF, as this is urgent appreciate help.
Thanks in advance.
ashish
|
|
|
|
|
Hi,
without viewing at your code, it is difficult to decide where the problem is. I'm doing the same
thing with itextsharp and a mysql db in some project. Here is how i basically do it:
Document myDocument = new Document(PageSize.A4);
MemoryStream mstream = new MemoryStream();
PdfWriter.GetInstance(myDocument, mstream );
myDocument.Open();
myDocument.Close();
byte[] fileData = mstream.GetBuffer();
As you're posting this in the asp.net forum, i suppose you want to write this pdf to your reponse stream? (or to file?!)
This is how i write it to response-stream in page-load of a download page
(you have to replace mimeType, fileName, fileSize and fileData by your own variables/strings - with
fileData being the byte[] and filesize the length of that byte[]):
Response.ClearHeaders();
Response.ClearContent();
Response.ContentType = mimeType;
Response.AppendHeader("content-disposition", "attachment; filename=" +
HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8));
Response.AppendHeader("content-length", fileSize.ToString());
Response.BinaryWrite(fileData);
Response.End();
Hope this helps. If you've problems writing/reading this data from/to a file, let me know.
|
|
|
|
|
I have an ASP.NET 1.1 web application that I'm required to migrate from an IIS 6 environment (Windows Server 2003) to an IIS 7 environment (Windows Server 2008).
I'm experiencing problems with the DHTML menus. In IIS 6 they display the text and the link whereas in IIS 7 it only displays the text, not the link.
Is there a patch that I need to install on Windows Server 2008 to rectify this problem? What am I missing?
The menus display when I view the site in Mozilla (however, the menus don't work 100%), but not IE8
Has anyone else experienced this problem?
I am most confuzzled!!
|
|
|
|
|
hey
I tried to use smtp server to send email using C#.net.
But it is giving error on client.Send(message);
it says:
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
So Is that problem in my code or is this the problem from the server. How to fix this ?
Thanks
Suchita
suchita
|
|
|
|
|
|
thank you. But I already solved it.
suchita
|
|
|
|
|
That's fine.
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
At what point can you determine when a web service connection has failed? As near as I can tell, you actually have to try calling a method in the service. Is that correct?
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
ya that's right
you need to call method to confirm it is getting connected..
For asp.net when you bind service reference
it will tell you by intellisense (at the time of
creating object or calling static method)
that whether you are connected to web service or not.
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
Hi all,
In my application, I m using a query which is quite lengthy.Some times give the message "Time Out Expire........".I am setting
sqlCommand.commandTimeout=4000
but it is not working and still display the message frequently.
can anybody help me,how to overcome this problem?
|
|
|
|
|
|
thanx 4 d reply,
can u plz explain when i have to set
Server.ScriptTimeout = 3600;
|
|
|
|
|
You need to set it on application load event.
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
Hi people,
I want to track what IP's/MAC addresses connect to my web application - but I am having troubles getting the IP of the connecting client.
Every variable or method I try - I seem to end up getting the IP of the server or of the internet provider of the client computer!
Has anyone come across this problem before and come up with a definite solution? I have tried many alternatives that I found via google - but none seem to work
Any help would be MUCH appreciated!
Thanks in advance.
Xav
|
|
|
|
|
|
There is no solution. The last step is a router which implements NAT, and forms the separation between the private address space (typically 192.168/16), and the internet. No IP information will cross that barrier.
If you're thinking of getting MAC addresses, it's even worse: the only address you'll ever see is the one of YOUR router. MAC addresses are a layer 2 thing (Media Access Control Layer), and routers operate on Layer 3 (Internet Layer) No Layer 2 information will ever cross a router.
|
|
|
|