|
i have the follow xml file :
<ListBoxes>
<row>
<Number>None</Number>
<Description>None</Description>
<Counter>999</Counter>
<Factor>0</Factor>
<Harmful>N</Harmful>
</row>
<row>
<Number>R1</Number>
<Description>R1 Explosive when dry</Description>
<Counter>1</Counter>
<Factor>1</Factor>
<Harmful>N</Harmful>
</row>
<row>
<Number>R10</Number>
<Description>R10 Flammable</Description>
<Counter>10</Counter>
<Factor>1</Factor>
<Harmful>N</Harmful>
</row>
<ListBoxes>
I have been trying to bind this to a listbox but have been unsuccessful, can anyone help. I have read that i may need an xslt file to transform it, is this true and could someone point me in a good direction on how to use xslt files
Thanks
-- modified at 6:22 Thursday 17th August, 2006
|
|
|
|
|
May be you can try giving DisplaySource property as "ListBoxes.row" OR "row" and DisplayMember as "Description" and ValueMember = "Number"
Hope this works for you.
- ashish
|
|
|
|
|
How to take reference of connection string or connection
which is written in the web.config in a c# code.
urgent
Regards
|
|
|
|
|
If it is inside the appsettings in config file then you can access it like this:
ConfigurationSettings.AppSettings.Get("the variable name");
Best Regards,
Apurva Kaushal
|
|
|
|
|
Hi there...
I have a user control (UC) which is dynamically added to a page. In this UC I have a DropDownList (DDL) (normally added - not dynamically). The problem is that the item which is set selected in the beginning in the DDL wont fire the OnSelectedIndexChanged event. In the beginning the item is selected – then I choose another item and it fires the OnSelectedIndexChanged event. When I then select the first selected item again the event isn't fired.
I don’t set the selected item in the beginning so it is the first item – but I have tried to set it as an item somewhere in the middle and then that item wont fire the event. So it has something to do with the first selected item.
Here’s my code...
The page which dynamically adds the user control:
m_plhTableForm.Controls.Clear();
UserControl ucTableForm = null;<br />
<br />
switch( strTableID )<br />
{<br />
...<br />
case CConstants.DB2ID_BUNKANUMER:<br />
ucTableForm = (UserCtrls_Tableforms_Bunkanumer_UC) this.LoadControl( "~/UserCtrls/Tableforms/Bunkanumer_UC.ascx" );<br />
break;<br />
...<br />
default:<br />
ucTableForm = null;<br />
break;<br />
}<br />
<br />
if( ucTableForm != null )<br />
{<br />
ucTableForm.ID = "WebUserCtrl1"; <br />
m_plhTableForm.Controls.Add( ucTableForm );<br />
}
The User Ctrl – aspx file (took out the brackets for rendering):
<br />
asp:DropDownList ID="m_cboBUNK" runat="server" CssClass="controlText" AutoPostBack="true" OnSelectedIndexChanged="onCboBUNKSelectedIndexChanged" /asp:DropDownList<br />
The User Ctrl – codebehind file:
Nothing big done here – data fetched and databinded to the DDL
|
|
|
|
|
spoa wrote: then I choose another item and it fires the OnSelectedIndexChanged event. When I then select the first selected item again the event isn't fired.
After the SelectedIndexChanged event gets fired, do you set any new selected index for the dropdownlist? Do you see the new item selected in the dropdownlist after the postback? Basically, the event is raised when the control detects the new selected item value in comparision with the current one which is persisted in the ViewState. You also make sure that the values (not text) of all the items are different.
|
|
|
|
|
Hi!
I want to do the Paging in the datagrid., I used data item command event also this
is for if we clicks the link button in that grid., it has to redirects to another
page., In that data grid, If i clicks the Next it shows the next form(which is i
denotes in the item command., ) instead of the next datagrid page...
The same code i used for this one is working properly in the other project there i
didn't use any item command event...
How can we solve this one..?
Prabu.T
|
|
|
|
|
You don't need any additional coding for the gridview paging (at least not in 2.0). All you have to do is to set the maximum number of records through PageSize property, and set AllowPaging property to true.
Also, since you are using a command field, make sure that EnableSortingAndPagingCallbacks property is set to false because you can't page on the client if you use a command field (due to the possibilities of a postback).
Let me know if you still have problems.
Nila
|
|
|
|
|
1. Using ADO.NET Datareader a user extracts data from a database table
having 1000 rows.He closed his browser in between.
that is after fetching only 50 records.
What happens to the Datareader?will it remain connected?
and will fetch 1000 records and what after?
will garbage collector collect and dispose it soon?
2. A user fetched dtata from a database table
using Dataset(Disconnected records) for updation.
Another user deleted the table just after.
what happens when the first user try to update the table after changes? Error or Something else
3.where is session id stored in ASP? in IIS aerver or ASP Engine
Thanks & Regards
Vishal Sharma
vishalsharma556@yahoo.co.in
|
|
|
|
|
If we help you get the job, do we get part of your paycheck, too?
--Jesse
|
|
|
|
|
Rule #1...don't post the same question in more than one topic board.
|
|
|
|
|
Ans 1: Active connection will be there in the database, connection won't close itself, because we used a datareader, it is a not disconnected like dataadapter. We have to manually close the connection.
Ans 2: We will get an exception exception like "concurrency violation ..."
Ans 3: No idea
Ram
|
|
|
|
|
The session ID in ASP.NET is usually stored as a nonpersistent cookie on the client. The format of this cookie for example, asp.net_sessionid=jhmbobkcbinehlpkjhopabbe.
In addition to the traditional nonpersistent cookie method of maintaining state, ASP.NET supports a “cookieless” mode. When the cookieless mode is enabled, ASP.NET embeds the session ID in the URL that is sent back to the client. This provides persistence for clients using browsers that either do not support cookies or have cookies disabled. Cookieless mode is worth keeping in mind, considering the current emotions concerning cookies and tracking customers with them.
Regards,
Uma
-- modified at 0:17 Friday 18th August, 2006
|
|
|
|
|
|
Hi Ram,
Thank u. can u give me ur id
Regards,
Uma
|
|
|
|
|
Here is my id e_ramsubbu@hotmail.com
Ram
|
|
|
|
|
Hi,
I am using Form Authentication in ASp.net 2.0 .
FormsAuthentication.SetAuthCookie(
"jhon", false);
FormsAuthenticationTicket ticket1 =
new FormsAuthenticationTicket(
1,
"jhon",
DateTime.Now,
DateTime.Now.AddMinutes(10),
false,
"Admin"
);
HttpCookie cookie1 = new HttpCookie(
FormsAuthentication.FormsCookieName,
FormsAuthentication.Encrypt(ticket1));
Response.Cookies.Add(cookie1);
Response.Redirect("Default.aspx");
In Authentication_BeginRequest event i have this code
if (HttpContext.Current.User != null)
{
if (HttpContext.Current.User.Identity.IsAuthenticated)
{
FormsIdentity id = (FormsIdentity)HttpContext.Current.User.Identity;
FormsAuthenticationTicket ticket = id.Ticket;
string userData = ticket.UserData;
string[] roles = userData.Split(',');
HttpContext.Current.User = new GenericPrincipal(id, roles);
}
}
I am using Sitemap xml file where nodes specified with role attribute. When on binding the sitemap to a treeview . All nodes are listing. Seems role based listing is not comming into action. How to solve this problem.
|
|
|
|
|
Have you enabled security trimming on your sitemap? You can do this by adding the attribute securityTrimmingEnabled="true" in your site map provider definition in web.config, as in the following example:
<siteMap defaultProvider="XmlSiteMapProvider" enabled="true">
<providers>
<add name="XmlSiteMapProvider"
description="Default SiteMap provider."
type="System.Web.XmlSiteMapProvider"
siteMapFile="Web.sitemap"
securityTrimmingEnabled="true" />
</providers>
</siteMap>
|
|
|
|
|
Hi Mike,
I've added the Tag to web config but the problem is still there . What to do.
|
|
|
|
|
|
Thanks for your valuable time mike.
It was some problem with the authorization folder paths in webconfig.
|
|
|
|
|
Hi friends,
Please help in
opening a file using c# on a button click...
I tried with link button by asigning the resolve url to the file path..
but i couldnt open it...
Regards,
Sivaprasad
|
|
|
|
|
What problem are u getting? Which type of you want to open?
Best Regards,
Apurva Kaushal
|
|
|
|
|
i want to open a .html file
Regards,
Sivaprasad
|
|
|
|
|
it should be filefield html control will solve your problem.
|
|
|
|