|
Farhad Eft wrote: i wanna have a button in my dataset
You can't have a button in a DataSet. I think you mean DataGrid. Use a template column.
only two letters away from being an asset
|
|
|
|
|
oops sorry i mean data list!
|
|
|
|
|
Hi!
I am using asp.net web application project in vs 2005. I have treeview webcontrol as a user control on left of the page. based on treenode selection i am creating a datagrid in main page. I maintained the selected node of treeview using sessions now i need to create a bread crumb so that user could navigate through the crumb. could someone help me thanks
|
|
|
|
|
Thanks for looking
Does anyone know how to stop clearing the 2 password fields when createuserwizard fails to create user
Ex: When users already exists, the wizard tells the user to give a different user, but clears the password fields
Anyway to prevent it??
Thanks
Alexei Rodriguez
|
|
|
|
|
write your own ?
It's common behaviour to clear passwords on every postback, most pages do it.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I just found out that its the textboxes behavior to clear passwords textboxes on postbacks and that a solution is to save the password on pageload and set it before the page renders
I think there should be an option to clear or not the password on postback
For a user is really anoying to retype passwords just because username already exists
Anyways, ill just try to handle postabacks and not write my own i was doing
Thanks
Alexei Rodriguez
|
|
|
|
|
Hi All,
Still relatively new to .Net and am starting to try new things. I know how to create and use a class that I have created external to a Windows project and am wondering if I could do the same with Web Forms. For instance, let's say I want to perform a function on every page that is loaded. Couldn't I create a class and call that method from the class to do this instead of pasting the code into every page's On_Load event?
Any assistance would be great. Even better would be a short tutorial or example code but this of course is dependent upon your generosity.
Thanks in advance.
|
|
|
|
|
Yes, you can write classes and put them in your app code area, in fact, your pages should not contain business logic, just the UI logic and calls to the middle tier.
The main difference is, every page is a class instance created by the server to serve just one page. Unless you store them in the session, any class instances you create, will not exist between pages.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I was going on this idea of keeping things separate (i.e. Database conversations and the like). My only problem is I am really not certain how to go about it. I have a limited resource at this current time (Pro ASP.NET 2.0 in C#2005) and it doesn't go into how to implement such logic. Can anyone refer another book or article that may give me some more guidance. I don't mind doing the work, I just need a direction.
|
|
|
|
|
ffowler wrote: I was going on this idea of keeping things separate (i.e. Database conversations and the like).
Good idea.
ffowler wrote: Can anyone refer another book or article that may give me some more guidance
http://www.codeproject.com/KB/dotnet/n_tier_web_service.aspx[^]
Basically, you would create class dlls, or in VS2005, just classes in the app code area. Then, your pages will just handle plumbing and create business objects. One common way around the fact that pages have no state, is to store all your objects in a database ( this works if your pages are content driven and need a DB to start with, not if you just have a couple of disparate objects ). Then your pages can pass around ids that are used to build objects from the data base.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Bingo! That will do. I do have other documentation on Web Services so I'll go on from here. Thanks again for your time.
|
|
|
|
|
I am new for sqlserver database connectivity.Can any one help me out?
Thanks,
|
|
|
|
|
This is a basic topic. I suggest you read the MSDN documentation, buy a book on ASP.NET/ADO.NET, or do a quick search of the web.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hi.
Has percent (%) any special usage in value of querystrings?
when I use for example %a7 as value, the result is a square, why?
Best wishes
|
|
|
|
|
Read this article[^]
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Here's some fun. Assume a parent panel, pnlBody, to which the following belongs.
If I include a panel pointing to a style in my aspx page, ala
<asp:Panel runat="server" ID="pnlHeader" CssClass="Header"></asp:Panel>
and then add a menu to it in code, e.g.
Menu mnu = new Menu();
pnlHeader.Controls.Add(mnu);
everything is groovy. I can then add text by creating labels and adding them to pnlBody.Controls. The end result is a top menu, the end of the menu color scheme (white on blue), and then the text (black on white).
Now's when the adventure begins. If, instead of putting pnlHeader in the aspx page I dynamically create it in code in the same order, the next line of text is formatted in the menu's style, e.g. white on blue.
Panel pnl = new Panel();
pnl.Controls.Add(mnu)
Label lbl = new Label();
lbl.Text = "test";
pnl.Controls.Add(lbl);
pnlBody.Controls.Add(pnl);
Renders fine on Firefox and Safari (menu white on blue, "test" black on white), but in IE7 I get two rows of white on blue (the second line being "test").
I've tried about every permutation I can think of. Do I just write my own menu control and give up on these guys, or am I missing a clever little workaround somewhere?
|
|
|
|
|
I need to make record keys for DataGrid row items available to my client-side code. I've tried adding a template column with a hidden input, and width of zero, but the column still appears in the browser. Is there some better way of sending the record key for a grid row to the client?
|
|
|
|
|
what do you mean
Brady Kelly wrote: DataGrid row items available to my client-side code.
|
|
|
|
|
Let's say a row in the DataGrid contains "Closed Job Report", and the ID for that report is 17. I needed to send that 17 to the client somehow, without including it in a column.
I have found a way, by adding an attribute to the Item in OnItemDataBound, this causes each table row rendered by the grid to have that attribute.
|
|
|
|
|
ah I see what you mean now, well done!!
|
|
|
|
|
Brady Kelly wrote: without including it in a column.
Why not a column that is not visible?
led mike
|
|
|
|
|
Have you tried setting DataKeyField ?
|
|
|
|
|
Hi
I have the following:
SqlDataSource_GridView_roomSchedule.SelectCommand =
"SELECT room_code, room_schedule.parentarea, instance_variant, Room_ID, project_room_description, level, areaslevel3.arealevelid " +
"FROM room_schedule, areaslevel3, areaslevel2, areaslevel1" +
"WHERE room_code like'" + searchroomcode + "'" +
"AND room_schedule.parentarea = areaslevel1.arealevelid AND" +
"areaslevel1.parentarea = areaslevel2.arealevelid AND" +
"areaslevel2.parentarea = areaslevel3.arealevelid AND" +
"areaslevel3.arealevelid in" +
"(SELECT areasLevel3_id" +
" FROM room_schedule_permission" +
" WHERE username = '" + username + "' AND" +
" permission_start_date < getdate()AND" +
" permission_expiry_date > getdate())";
I get the error Incorrect syntax near keyword 'like'.
but when I put this code in sql query analzyer and hardcode the values where string values are it works fine, any help would be appreciated
thanks
|
|
|
|
|
a-+s-+p-+ wrote: "WHERE room_code like'" + searchroomcode + "'" +
I think you need to add '*' to the right and left of the searchroomcode
"WHERE room_code like'*" + searchroomcode + "*'"
if the searchroomcode is not of type string, remeber to call ToString()
"WHERE room_code like'*" + searchroomcode.ToString() + "*'"
I hope this helps
Mohamed Gouda
Egypt
|
|
|
|
|
Use a stored proc and stop writing inline SQL
only two letters away from being an asset
|
|
|
|