|
Hi,
How to set a background image in a ListBox control. And when i take a printout of this, back ground image should be appeared in the printout. I am using VS 2003 and language is C#. I am new to .NET. Please suggest me the proper solution.
Thank u
|
|
|
|
|
This is a web application ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Yes this is a web application
thanks
|
|
|
|
|
ya...its a web application
|
|
|
|
|
Our application needs to support multilanguage(UTF-8). Web.Config entries are encoded to UTF-8. We are using ajax and passing some special characters in querystring which are automatically removed when it comes to the aspx page. When we debug javascript the URL is showing the exact string when calling XMLHTTP send method. Javascript escape also didn't work. Any ideas on how to go about?
|
|
|
|
|
What about "encodeURIComponent() " link] ?
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
im creating controls html ul and li on server side, but wen the aplication is running i want to show a friendly code html...
this is my code:
HtmlGenericControl ul = new HtmlGenericControl("ul");<br />
ul.Attributes.Add("class", "mylist");<br />
HtmlImage img = new HtmlImage();<br />
img.Src = "../Handler.ashx?id=" + (int)row["id"] + "&height=100&width=100";<br />
HtmlGenericControl li = new HtmlGenericControl("li");<br />
li.Attributes.Add("class", "imgProd");<br />
li.Controls.Add(img);<br />
ul.Controls.Add(li);
so when this code is running... on client side... i have something like this:
<'ul'><'li'>image blablabla<'/li'><'/ul'>
all this in one line!!
but i want to break line AFTER some close tags... to create a code like this:
<'ul'>
<'li'>image blablabla<'/li'>
<'/ul'>
this on server side! Can anyone help me whit this!?
obs: I put the ' ,here in message, cause on forum it was renderized as real tags ... =/
Gustavo Ushijima
|
|
|
|
|
I would then suggest you use a StringBuilder object and build the HTML code that way, so you can control the formatting.
StringBuilder sb = new StringBuilder();
sb.AppendLine("<ul class='mylist'>");
sb.AppendLine("<li class='imgProd'><img src='../Handler.ashx?id=" + (int)row["id"] + "&height=100&width=100;></li>");
sb.AppendLine("</ul>");
Response.Write(sb.ToString());
You might be able to use the HtmlTextWriter as well, but I haven't looked at it too much. It appears to have a method for WriteLine and an Indent property so that can help you format the output as well.
-- modified at 19:33 Friday 21st September, 2007
|
|
|
|
|
this works too, but whit the response.write i cannot especify where this codes will appear... and sometimes i´ll nedd to add a control inside the tags li...
using the estructure that i posted before... isnt a method to break line after LI´s tags??
in the code...
htmlgenericControls li = new htmlgenericControls("li");
something like this:
li.after_close_tags = "\r" or Eviromet.NewLine or anything else to format this output?
|
|
|
|
|
Dear all,
I have 3 buttons placed one above the other inside template of gridvew.
I want to the buttons one after the other on click on them like cards.
Can any one give the code or give me sollution?
sanjay kumar samantaray
|
|
|
|
|
I have no idea what you're asking.
Please consider rephrasing the question.
Paul
|
|
|
|
|
dear all ,
i want to change the color of gridview's cell dyanamically,
default color is green.
on click on green cell it should be yellow.
on click on yellow cell it sould be red.
clicking on red cell the color should get changed to green
sanjay kumar samantaray
|
|
|
|
|
Hello All,
Thank you for reading this post. Here is my issue. I have an ASP.NET 2.0 web application, that requires users to login and then they are shown the welcome page on successful login(Iam not using forms authentication, user's login credentials are validated against database and redirected to welcome page). The Welcome page has a logout button, on clicking which I clear all session variables, destroy all login based cookies and redirect to the login screen again. My problem is this. After I logout and reach the Login page if I hit the back button I go back to my welcome screen with all user information even though I have explicitly cleared session and cache. Please let me know how I can enforce the login page when back button is pressed. This is what i have on my logout page.
Protected Sub lkbLogout_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lkbLogout.Click
Session(CustomerInformation) = Nothing
Session.Clear()
'Remove all cookies
If Not Request.Cookies(ConfigurationManager.AppSettings("Cookie")) Is Nothing Then
Response.Cookies(ConfigurationManager.AppSettings("Cookie")).Expires = DateTime.Now.AddYears(-30)
End If
If Not Request.Cookies(ConfigurationManager.AppSettings("Cookie2")) Is Nothing Then
Response.Cookies(ConfigurationManager.AppSettings("Cookie2")).Expires = DateTime.Now.AddYears(-30)
End If
If Session(CustomerInformation) Is Nothing Then
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.Cache.SetExpires(DateTime.Now - New TimeSpan(1, 0, 0))
Response.Cache.SetLastModified(DateTime.Now)
Response.Cache.SetAllowResponseInBrowserHistory(False)
Response.Redirect("login.aspx", True)
End If
'------------------
response.redirect("login.aspx",true)
|
|
|
|
|
Responce.Cookies is array method not function. You have to use [] not (). This stand also for Session
example:
Response.Cookies[ConfigurationManager.AppSettings("Cookie")].Expires = DateTime.Now.AddYears(-30)
|
|
|
|
|
Will the above solution solve my issue ? Iam using VB.NET for my coding not C#
|
|
|
|
|
Sorry didn't read your post very well. You coud write javascript that prevents back buttion.
But when you press back button, the browser displays a page in previous. It doesn't call a server to check if that is true. It is imposible.
But you could check every time a postback occourd for every page
|
|
|
|
|
Subject says it all.
I've been searching here and across the web for an ASP.NET DatePicker control.
So far, none have handled NULL values properly (unless puking is proper).
Anyone know if Microsoft will fix this in 2008? If so, I'll tell the boss to shelf this.
"Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit..."
"There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain..."
|
|
|
|
|
If you're on 2.0 you can use the Null Coalesce operator to avoid sending a NULL value to the control.
string origDate = null;
string newDate = origDate ?? DateTime.Now.ToString();
So if origDate is NULL, it will use Now.
Hope that helps you get around your problem. If you're using VB.Net, then I have no clue if it has a Null Coalesce equivalent.
|
|
|
|
|
Thanks for the reply.
I think I have 1 line of VB code in my ASP.NET application.
Everything is DataBound controls, so not sure where to intercept that.
Guess I'll have to modify someone's control.
"Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit..."
"There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain..."
|
|
|
|
|
I am working on Visual studio 2005.
I am using following js function to create a module having Textarea on page.aspx file.
Now how can i save the content of page(Periodically).
---------------------------------------------------------------------------
function AddTextArea(){
TextCount++;
var header1='<table id="header" width="500px" height="15px"><tr><td align="center"><b><b>Place Your Text Here</b></b></td><td align="right"><img src="../images/icon-close.jpg" id=';
var header2=' width="12px" height="12px" onclick="javascript:removeText(this.id);"/></td></tr></table>';
var textArea='<textarea rows="2" cols="25" align="left"></textarea>';
var footer='<table id="footer" width="500px" height="15px"><tr><td> </td></tr></table>'
var mainDivElement = document.getElementById('mainDiv');
var newText = document.createElement('div');
newText.setAttribute('id','text'+TextCount);
newText.style.width="500px";
newText.style.border="1px solid blue";
newText.innerHTML=header1+TextCount+header2+textArea+footer;
mainDivElement.appendChild(newText);
}
-------------------------------------------------------------------------------
Can any one help ?
|
|
|
|
|
I was wondering if any of you have experienced the following behavior because I can't figure out why it is occurring.
When I switch between code view and design view for my site Visual Studio indicates "getting file xyz.gif" in the lower left before it renders the design view. It repeats this for any other necessary files needed to display this. That is all normal. The problem is that it is taking far too long. For example, files that are 1-2kb in size may take minutes to "get". The same thing happens if I CTRL + F5 to build my site. It takes way too long. Much longer than it did before to get the files.
The other odd thing is that it seems like it requests files it shouldn't need because they haven't changed at all between edits. For example, I'll modify a gridview color and hit OK and it starts redownloading xyz.gif which it just downloaded moments prior.
This never used to happen. I am using FTP instead of FrontPage extensions to connect to the site (c# asp) as I always have. The computer I am editing on just recently had Windows reinstalled from scratch with a fresh install of Visual Studio with all updates and SP's applied. It has also been several months since I have done development on the site so maybe something changed on the web host's end.
If I use an FTP client and connect to download files from my site it seems to go very fast so I am not sure why this is occurring.
Is there some cache'ing setting that I don't have turned on in my new Visual Studio install? Is there some other setting I need to toggle to improve performance? Any thoughts or ideas to help me drill drown the troubleshooting on this more?
Thanks!
|
|
|
|
|
Huw moch of memory you have?
Did you terminated all unnececary process in background?
Start->Run->msconfig.exe->Startup (Modify your startup programs)
|
|
|
|
|
2 gigabytes of memory. Plenty of it is free. There are no unnecessary startup items running. The CPU use is very low. Whatever it is is not resource related.
|
|
|
|
|
Try closing all open document in VS, Try delete suo file, Or try transfers all file localy, when finished, move back
|
|
|
|
|
How do I delete the suo file (not sure what that is)?
How do I transfer the files locally?
Thanks!
|
|
|
|