|
Maxdd 7 wrote: Bem vindo <% Response.Write(Session["nome"].ToString()); %>!
whats tht '!'
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
That's why he is getting the error !
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
I thought So..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
Solution has already provided by CG, but he is not interested with that solution.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Use
<% =Session["nome"] as string %> instead of <% Response.Write(Session["nome"].ToString()); %>.
As Response is implicit here for the Designer, you cant access it directly.
|
|
|
|
|
Abhishek Sur wrote: <% =Session["nome"] as string %> instead of <% Response.Write(Session["nome"].ToString()); %>.
That way gives the same error.
Maybe you are all right, I really should remove that. I was trying do that because I had a problem using LoginView:
<asp:LoginView id="logview" runat="server">
<LoggedInTemplate>
Welcome <asp:LoginName id="txtUserName" runat="server"/>
</LoggedInTemplate>
</asp:LoginView>
The problem is: since the login name is email ID, (and the name of the user is another field in DB), it appears something like "Welcome tmm@yahoo.com"
|
|
|
|
|
Yeah... I think this solves the problem.
Other than that you can store the Displayname in a protected variable in server side and use <%=yourvariable%> also.
|
|
|
|
|
Hi
I am looking to ask whether anyone can point me in the right direction to a solution involving JavaScript, a HTML table and print.
What I have is a HTML table, which includes paging and a column with hyperlinks. However, what I am looking to do is to print out the table, but not to include the column with hyperlinks, and to print the whole table without the paging. My aim is to not to regenerate the table again from another query, but to use the sam query and page.
Does anyone know how it is possible to do this?
|
|
|
|
|
The only way to do this is to have a popup showing only what you wnat to print, and printing that. That's why every site that does anything like that, does it that way.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Yes you can do so, but the page should contain the entire data. I mean if you have some portion of the table is in the server which comes whenever your page is posted back, you cant print that portion.
Just load the entire table content when the page loads.. (you may hide the portion that you dont want to show in the page using display = none css property)
Now to print the content apply CSS Ruleset for @media print
You can easily hide elements from printing using this rule. Just add display:none for the elements that you want to hide in @media print css.
Take a look at the w3 documentation on @media css.
http://www.w3.org/TR/CSS21/media.html[^]
I am sure this will help you.
|
|
|
|
|
Hi,
I need to render a TreeView control relative to the width of the window. I can place the TreeView in a to show scrollbars, etc. but it seems that if I wish to set the control's width relative to the page size, so that it changes width as the user changes the window size using the mouse, I'm stuck. I can set a specific width and that works fine but if I try and set a relative column width, say 50%, the control ignores the width of whatever control it's in context of. The problem is that a user may have their resolution set to XGA or WUXGA so I need the flexibility of relative sizing as opposed to fixed.
Thanks for any advice offered
|
|
|
|
|
Put the TreeView inside a div tag.
The parent div tag should have the style display:block, width 100%;.
Add a css class for the treeview set display:block, float:left, width:50%. Give that a try.
I didn't get any requirements for the signature
|
|
|
|
|
I did that but the TreeView was instantiated at page load as the same width as the widest TreeViewItem. Further, when I selected an item in the TreeView, it subsequently *increased* the width of the TreeView to accommodate the selected item.
As you can imagine, I'd like the page to load, and for the TreeView's width to always be governed by the size of the containing element, in this case, a table column and contained div.
It seems that if I set a specific width for the TreeView, it remains at that width no matter how wide the TreeViewItems are. I just don't see why the TreeView control can't inherit its width from the containing element - where the table is defined as 100% the width of the page and the containing column is set to 50% of that.
|
|
|
|
|
Yes.. this is really a problem. Actually Treeview has a min-height specified. So if you resize, it wont go after a certain width.
So you want the scrollbar to appear after it reaches a certain size. As it always holds its min width, you can set the width of the container to show the scrollbar of the container.
Just place the treeview inside of a <div> with overflow:auto for width. For example
<div style="width:128px;overflow:auto">
<asp:TreeView runat=... </div>
Hope it solves your problem.
You can use
<asp:TreeView ID="TreeView1" runat="server" Width="178" ...
to define width of the Treeview.
|
|
|
|
|
I'm afraid that's exactly what I've tried doing. Placing the div around the control provides the TreeView with the scroll bars I need but it doesn't allow me to control the relative width of the TreeView. It seems the TreeView's width is governed by the width of the TreeView Items it contains unless the width is specified. Of course, if I resize the page, the TreeView remains at the same size which is fine if you know what resolution the user will be using, but if the user can display the page in anything from XGA to WUXGA, what looks fine on a low resolution screen will look pretty poor on a high res one
|
|
|
|
|
Yes, as an user, it is not good to have horizontal scrollbar in place. Users generally dont like to scroll the horizontal scroll bars(at least web users).
How about dealing width dynamically using JS ? You also need to have a minimum width set, so that every time the browser resizes, you need to trap browser resize event and set the size of it dynamically using javascript.
I generally do make the site in certain fixed resolution, and leave blank space around the content when in high resolution... if full screen content is not required exactly.
Depending on your requirement you need to make your site.
|
|
|
|
|
Generally, speaking I do try and ensure I use fixed sizes for my ASP.NET sites. Unfortunately, in this instance, a user asked if the width of the TreeView could be increased. They're using a high-res screen but other users use laptops with relatively low-res screens. The content of the TreeView can be very wide which is why the high-res user wants to take advantage of the res they're working at. The only other thing I can think of is to use a fixed width and display a Tooltip showing the full text of a TreeViewItem that the mouse is positioned over.
It really is a pain that the TreeView is so inflexible and it's unacceptable that it's never been fixed considering how long it's been available to developers :/
I now have to implement a fix which will be at best a compromise
|
|
|
|
|
I have a string in the format "2|3|4"
I then split this string in an array.
the problem i'm having is telling the form to iterate through the array and set the checked property of the checkedlistbox to true if the value is equal to that in the array.
If anyone can help me it would be most appreciated.
ASP all the way
|
|
|
|
|
Something like the following.
<br />
foreach (listitem li in yourControl.Items)<br />
{<br />
foreach (string s in yourArray)<br />
{<br />
if (li.value == s)<br />
li.selected = true;<br />
}<br />
<br />
}<br />
I didn't get any requirements for the signature
|
|
|
|
|
Thanks I changed the code then realized that the problem was originating from the xml file i was binding to the checkboxlist. Thanks for your help.
ASP all the way
|
|
|
|
|
A bit shorter version with one loop :
string elements = "2|3|4";
string[] arr = elements.Split('|');
foreach (ListItem fld in chklst.Items)
fld.Selected = arr.Any(item => item.Equals(fld.Value, StringComparison.InvariantCultureIgnoreCase));
|
|
|
|
|
Hi-
i am wondering if there is any way to do the following:
i want the other developers to just create an aspx page...and put some defined tags...lets say something like...
<ucone></ucone>
<uctwo></uctwo>
<ucthree></ucthree>
if they put the above tags in their aspx page...and also the container user control (that i create) on the same page....the container user control will retrive the above tags and load appropriate user controls (with those names as tags) dynamically in the container user control..hope it makes sense
thanks
modified on Monday, November 23, 2009 11:38 AM
|
|
|
|
|
samir80 wrote: can't use angle brackets in the post
Yes you can, just put it in a code block like this to make it readable
<ucone></ucone>
<uctwo></uctwo>
<ucthree></ucthree>
|
|
|
|
|
Yes why not.. Actually User control is used to make a module of some content. It has both designer and Code.
I would recommend to use Custom control for this. Create a Template for layout in your custom control where if user places these tags, load the appropriate content accordingly.
This might help you to create custom control using Templates :
http://msdn.microsoft.com/en-us/library/aa478964.aspx[^]
Cheers.
|
|
|
|
|
So I am working a on a new application. It is rather small, but critical. The maintenance section of the program has about 3 users with about 15 users of the display.
Anyway, I have a few pages that do simple CRUD operations via some stored procedures. Personally, I am content to use a datareader in the code behind to load the form with data that will be edited. However, I know some developers cringe at the thought of using a datareader in the code behind.
Anyone have an opinion on this?
I didn't get any requirements for the signature
|
|
|
|