|
i solved it myself now
like this.
ListItem li = new ListItem("--Select--","0");
ddl.Items.Insert(0, li);
ddl.SelectedValue = "0";
//ddlCountry.Items.Add(lst);
for (int i = 0; i <= dsFormTypeForDropDown.Tables[0].Rows.Count-1; i++)
{
ListItem lst = new ListItem();
lst.Text = (string ) dsFormTypeForDropDown.Tables[0].Rows[i][1];
//lst.Value = (Int32 ) dsFormTypeForDropDown.Tables[0].Rows[i][0];
ddl.Items.Add(lst);
}
|
|
|
|
|
Fine.
Regards,
Satips.
|
|
|
|
|
|
Welcome
Regards,
Satips.
|
|
|
|
|
hii i m trying to retrieve data from sql using C#.net
private void Page_Load(object sender, System.EventArgs e)
SqlConnection con;
SqlDataReader dr;
SqlCommand cmd;
con = new SqlConnection("Server=ADNAN;Database=system;UID=sa;pwd=");
cmd = new SqlCommand("Select * from info",con);
con.Open();
dr= cmd.ExecuteReader();
Repeater1.DataSource= dr;
Repeater1.DataBind();
dr.Close();
con.Close();
Login failed for user 'sa'. The user is not associated with a trusted SQL Server connection.
When user id and password is removed..recieves a message
"Login failed for user ' ADNAN \ASPNET"
Ahsan
|
|
|
|
|
go to the enterprise manager, and create a new user for the database SYSTEM.
it should be an asp.net user, also grant all the privileges..
hope it helps
Kunal
|
|
|
|
|
Hi All ,
A site which i have developed is working on both http and and using (SSL certificate)https. My problem is that i want the use https only when once the user logged in otherwise it works on the http.
Should i redirect to Page if the session object is not null then
redirect to https://abc.com/default.aspx else http://abc.com/default.aspx
or Is there another way in web.config or else to handle these protocols.
basically i don't want to hardcode the root path
Response.Redirect("https://abc.com/default.aspx")
OR Response.redirect("http://abc.com/default.aspx")
instead of
Response.Redirect("~/default.aspx");
Thanks in Advance....
Regards
Srnandan..
|
|
|
|
|
Get the current requested path. Check whether session is alive or not. If yes replace http with https.
|
|
|
|
|
Hi,
no matter wat i do i get this error the .net scripts run fine on my local server but on remote server they give this error.
Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: This configuration section cannot be used at this path. This happens when the site administrator has locked access to this section using <location allowoverride="false"> from an inherited configuration file.
Source Error:
Line 23: <pages stylesheettheme="Magnolia">
Line 24: <anonymousidentification enabled="true">
Line 25: <trust level="Medium">Line 26: <customerrors mode="Off">
Line 27: <profile enabled="true">
Source File: D:\Domains\.....\wwwroot\web.config Line: 25
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
Thanks.
|
|
|
|
|
DKalepu wrote: net scripts run fine on my local server but on remote server they give this error.
Obviously problem is with remote server settings.
DKalepu wrote: Parser Error Message: This configuration section cannot be used at this path. This happens when the site administrator has locked access to this section using from an inherited configuration file.
You can "seal" sections of web.config (or machine.config) so that it cannot be overriden in "inherited" config files. Not allowing to change trust level quite makes sense, if you really need that change, contact your administrator.
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
"Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
Thank you so much for the Help.
I have contacted the administrtor& he gave full access to it.
My problem is Solved...
|
|
|
|
|
i need to remove the selected item from the listbox when i click on a button... how can i do tat?
plz anyone help me..
|
|
|
|
|
Hi,
ListBox1.Items.Remove(ListBox1.SelectedItem);
To succeed, we must first believe that we can.
Sherin Iranimose
|
|
|
|
|
hi
Could someone plz help me!
I am getting an "IndexOutOfRangeException not handled by user", in my code when im tryin to get a specific record, selected via a dropdownlist, and show the fields in textboxes.
my code is like this:
reader.Read();
ShipperDetails shipper = new ShipperDetails((int)reader["ShipperID"],
(string)reader["CompanyName"], (string)reader["Phone"]);
reader.Close();
this is where the error comes up.
Please help..
|
|
|
|
|
If you step through, I'd guess that one of these strings does not point to a record in the reader.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
Hi
I created image buttons dynamicaly an i wrote click event for image controls. but click event is not working
code is as follows
for (int i = 1; i < 11; i++)
{
img = new ImageButton();
img.ID = "img" +i.ToString();
img.ImageUrl="pg/1212/"+ i +".jpg";
img.Click += new ImageClickEventHandler( img_Click );
pl.Controls.Add(img); (pl is place holder control id)
}
protected void img_Click ( object sender, ImageClickEventArgs e )
{
ImageButton img = ( ImageButton )sender;
Response.Write(img.ID + "");
}
after page load when i click image button, click event is not working...
control is not going to click event
plz help me
Thanks in advance.
Haritha
-- modified at 5:00 Monday 28th May, 2007
Haritha
|
|
|
|
|
The only problem that i think will causing u this problem is that u write the code for creating images in the Page_Load event, u must write it in Page_init event
|
|
|
|
|
how can we use stylesheet?
|
|
|
|
|
|
first add the .css file in your project..
then go to the html view of your page and drag drop the file with in the head element
now u can set cssclass of your controls
google or anyother search engine is a good option for this kind of queries
|
|
|
|
|
Hi,
I am using a datagrid having checkboxs. these checkboxs are not bound to any datafield.The problem i m facing is that when i select some checkboxs on page1 of datagrid and go to the next page and come to the previous page i found all my selected checkboxes are unselected.
Please tell me how will i overcome this problem.
Alok Kumar....
|
|
|
|
|
alok_2k3 wrote: when i select some checkboxs on page1 of datagrid and go to the next page and come to the previous page i found all my selected checkboxes are unselected.
It will because on pageindexchanged event you are binding the grid again. So all the checkboxes will be cleared. One thing you can try is storing the checked results on some temporary location like session when page index is changed. and when it comes to the previous pages, get values from this and check the checkboxes.
|
|
|
|
|
Hi
In Page Index, you are binding again to the datagrid. Checked values are not stored when you move out from that page.
Before clicking for sorting / paging, you should maintain all checked values (any unique id) in a hidden variable as comma-separated values. (That is,Use ClientID of that check box).
When coming back to a page, you should check whether a row (that row should be unique id) was already checked by comparing with that hidden varible. This can be done by using javascript in a for loop.
Hope you got it.
Harini
|
|
|
|
|
Hi all,
Iam using a client application developed in c# that connects to a webservice in a remote server.I have set the Client protocol version to 1.0 in the client application. The code is
protected override System.Net.WebRequest GetWebRequest(Uri uri)
{
System.Net.HttpWebRequest webRequest = (System.Net.HttpWebRequest) base.GetWebRequest(uri);
webRequest.ProtocolVersion = System.Net.HttpVersion.Version10;
return webRequest;
}
I compiled the application connecting to the webservice in the remote server.
But when i viewed the HTTP post info using Ethereal the POST info displayed was
HTTP POST/xx/xx.asmx HTTP1.1
RequestMethod:POST
RequestVersion:HTTP/1.1
Iam using the protocol version set to 1.0 in the code but the application is still using HTTP 1.1.Why?
Can anyone help me resolve this issue.
Any help will be appreciated.
Thanks
Ramya
|
|
|
|
|
Hi all,
I m using the panel in asp.net 2003 .
I've used the panel many times before with buttons, but this time i need to use an update panel so that when a drop down list has its index chasnged that certain panels are shown and certain panels are hidden.
The problem i'm encountering is that the page does the post back,
on my page.aspx.cs i have the
on drp selected index changed event
if( drp.seleteditem.value==1)<br />
<br />
{<br />
panle1.visible=true;<br />
panel2.visible=false;<br />
}<br />
else<br />
{<br />
panel1.visible=false;<br />
panel2.visible=true;<br />
}
I AM USING .NET 2003. Can i implemnt this without postbacking???
Thanks in advance
All I ever wanted is what others have.... CrazySanker
|
|
|
|