|
Hi,
I am using a DataList Control using ASP.NET 2.0... I am getting the following error...
NEWLINE IN CONSTANT.....
I do not know what's wrong, can anyone help...........Here is the code.
Thanks
<asp:DataList ID="reviewsDataList" runat="server" CssClass="mainContent" RepeatColumns="4" RepeatDirection="Horizontal">
<ItemTemplate>
<div class="reviewItem">
<asp:HyperLink ID="reviewHyperLink" runat="server" NavigateUrl='<%#DataBinder.Eval(Container.DataItem, "review_id", "review.aspx?reviewId={0}) %>'>
<%#DataBinder.Eval(Container.DataItem, "summary") %> </asp:HyperLink>
<br />
<%# DataBinder.Eval(Container.DataItem, "title")%>
<br />
<b>
<%#DataBinder.Eval(Container.DataItem, "rating")%>
</b>
<br />
<i>
<%# DataBinder.Eval(Container.DataItem, "reviewer") %>
</i>
</div>
</ItemTemplate>
</asp:DataList> </p>
Sanjeev
|
|
|
|
|
erm - you have a newline in a constant ? :P
I'd expect it to mean a set of quotes is not matching up, but I can't see it.
sanju0276 wrote: "review.aspx?reviewId={0})
Got it
"review.aspx?reviewId={0}")
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thank you.....It worked......I had not seen that....
Sanjeev
|
|
|
|
|
Took me 5 minutes, once I knew what to look for
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Christian Graus wrote: Took me 5 minutes, once I knew what to look for
Counting the four minutes and fifty seconds for the page to load so that you could start looking?
---
b { font-weight: normal; }
|
|
|
|
|
Hi every body,
How are you?Ihope fine?
My question is i want to build online survey,sure this needs a database connection.Iwant to know how i can get the answers of pepole who fill the survey,more specific how i cant know that 3 outof 6 answer male for example.
plese answer me.Any one who makes a survey can help me.
|
|
|
|
|
AlaaMahmoud wrote: Iwant to know how i can get the answers of pepole who fill the survey,more specific how i cant know that 3 outof 6 answer male for example.
Ask them their sex, seems like the way to go here. I'm not sure that I get your question ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Offcourse you will have to ask for their sex. otherwise i don't think there is some way to know either that person was a male of female.
sAqIb
"Our scientific power has outrun our spiritual power. We have guided missiles and misguided men."
Dr. Martin Luther King Jr.
|
|
|
|
|
Hi,
I have concatenated my <a></a> in my .aspx page, and the end result in HTML looks like:
<a href="mailto:me@mymail.com?Subject=Enquiry from J&D Ship Services">me@mymail.com</a>
However, when I click on this link, the mail screen opens, but the subject line is not displayed correctly. All that displays in the subject line is:
Enquiry from J
This is how I created the link:
<a href="mailto:<%= Globals.InfoEmail %>?Subject=Enquiry from <%= Globals.CompanyLongName %>"><%= Globals.InfoEmail %></a>
How do I fix this?
Regards,
ma se
|
|
|
|
|
<blockquote class="FQ"><div class="FQA">ma se wrote:</div><a href="mailto:<%= Globals.InfoEmail %>?Subject=Enquiry from <%= Globals.CompanyLongName %>"><%= Globals.InfoEmail %></a></blockquote>
The ampersand is used ina URL to split variables. To be safe you should always URL encode variables used in a URL.
Change to:
<a href="mailto:<%= Globals.InfoEmail %>?Subject=Enquiry from <%= Server.URLEncode(Globals.CompanyLongName) %>"><%= Globals.InfoEmail %></a>
---
How to get answers to your questions[^]
|
|
|
|
|
i am in problem when rendering image in webpage.in my case there is a webservice which basically read a gif file and
return a arrar of byte to the client and now i have array of byte.now i want to show image after reading array of byte
without saving it.i wrote a code whic not giving any error but not working also.now here i am giving the small code and
any guys see any then pls rectify my code.
imageStream = new MemoryStream();
imageStream.Position = 0;
imageStream.Read(bytBytes, 0, (int)bytBytes.Length);
Response.ContentType = "image/gif";
Response.BinaryWrite(bytBytes);
bytBytes this is array of byte and here image content is stored as array of byte.
so pls help me to solve my problem and it is very urgent.
-- modified at 1:23 Thursday 19th October, 2006
tbhattacharjee
|
|
|
|
|
Try
Response.Flush();
Response.Close();
|
|
|
|
|
|
This will not work. You need to read the header of the image, after that read all the contents, and then assign it to the variables.
regards
sAqIb
"Our scientific power has outrun our spiritual power. We have guided missiles and misguided men."
Dr. Martin Luther King Jr.
|
|
|
|
|
This will not work. You need to read the header of the image, after that read all the contents, and then assign it to the variables.
regards
sAqIb
"Our scientific power has outrun our spiritual power. We have guided missiles and misguided men."
Dr. Martin Luther King Jr.
|
|
|
|
|
I think do you not send any content to client. Where in code did you write content to imageStream.
|
|
|
|
|
Sir,
Can u please explain the difference between response.redirect and Response.Transfer with the help of a single simple example.
Thanks
|
|
|
|
|
Redirect and Transfer both cause a new page to be processed, but the interaction between the client (web browser) and server (ASP.NET) is different in each situation.
Redirect: A redirect is just a suggestion – it’s like saying to the client “Hey, you might want to look at this”. All you tell the client is the new URL to look at, and if they comply, they do a second request for the new URL.
If you want to pass state from the source page to the new page, you have to pass it either on the URL (such as a database key, or message string), or you can store it in the Session object (caveat: there may be more than one browser window, and they’ll all use the same session object).
Transfer: A transfer happens without the client knowing – it’s the equivalent of a client requesting one page, but being given another. As far as the client knows, they are still visiting the original URL.
Sharing state between pages is much easier using Response.Transfer – you can put values into the Context.Items dictionary, which is similar to Session and Application, except that it lasts only for the current request. (search for HttpContext in MSDN). The page receiving postback can process data, store values in the Context, and then Transfer to a page that uses the values.
Regards,
Satips.
|
|
|
|
|
That sounds like you copied a question from a test... I can explain the difference, but if you need it in some special form, that is up to you.
Response.Redirect will send the browser a response that is a redirection page to the URL that you specify. The URL can be any resource anywhere.
Server.Transfer stops execution of the current page and executes the page that you specify as part of the current response. The page has to be on the same server.
---
b { font-weight: normal; }
|
|
|
|
|
Hi,
Am getting this error in the Button click event after entering the credentials, not getting this error each time i click. I searched for this in
all the msdn, blogs, asp.net forums etc... They r saying to register the event. I did the same by writing the following code
protected override void Render(HtmlTextWriter writer)
{
Page.ClientScript.RegisterForEventValidation(Login1.UniqueID);
base.Render(writer);
}
But there is no use still am getting the same error even after registering the event too. Can anyone help me how to overcome this problem.
Thanks in Advance!
|
|
|
|
|
In your web.config on the page tag set EnableEventValidation=False
|
|
|
|
|
Thanks for reply!
This is the security issue right. I cant do that.
Can I Have Other solution for this?
Thanks!
|
|
|
|
|
help me!
when i use Response.Redirect how do i determine the target ?
i want that my page open in the main frame in my page?
when i use the link we can the target by target="main"
but in this case ...?
what can i do?
ava_h
|
|
|
|
|
You can't determine the target. The target was determined already when the request was sent to the server, so it's too late to change the target.
You either have to change the target before the request is sent from the browser, or you have to send a response that is a page that contains Javascript that will make the browser send a new request with the target you want.
---
b { font-weight: normal; }
|
|
|
|
|
I have recieved no answer from my previous query but I do have more information so hopefully I someone may have some more information for me. (For a quick reminder I am creating an ASP.NET control to upload n number of files and as part of that I am using Javascript to dynamically generate file inputs through the DOM)
When uploading a file through ASP.NET the encoding type of the form must be "multipart/form-data" which I already knew, however, it must be the HtmlForm for the page that is set and not just any form. (http://msdn2.microsoft.com/en-us/library/system.web.ui.htmlcontrols.htmlform.aspx, and http://msdn2.microsoft.com/en-us/library/system.web.ui.htmlcontrols.htmlinputfile.aspx)
A simple loop through Page.Controls reveals the HtmlControl for the page if there is one. (Surprise there is no method to return it! so you must roll your own) With this set I am still unable to upload files!
Now here is where it gets really interesting: If I add <input type="file" id="thisIsATest" runat="server"/> somewhere in my user control everything works even though I am not using the thisIsATest element for the upload. I can't find any meaningful difference in the HTML source between the two.
Any ideas?
On two occasions I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question. - Charles Babbage
|
|
|
|