|
what path you have give for AD?
Try to run it from you Browser
ldap://ip address/
and let me know the result
Best Regards
-----------------
Abhijit Jana
Microsoft Certified Professional
"Success is Journey it's not a destination"
|
|
|
|
|
I tried to export gridview info to excel. I got this error.
Control 'grdLIST' of type 'GridView' must be placed inside a form tag with runat=server.
This my gridview design.
<asp:GridView ID="grdLIST" runat="server" Visible="False">
</asp:GridView>
I didn't setup fields, because field name is changing due to date term.
This is aspx codeing
protected void cmdEXCEL_Click(object sender, EventArgs e)
{
Response.Clear();
Response.ClearContent();
Response.ClearHeaders();
Response.AddHeader("content-disposition", "attachment;filename=CadilacReport.xls");
Response.Charset = string.Empty;
Response.Cache.SetCacheability(System.Web.HttpCacheability.Public);
Response.ContentType = "application/vnd.xls";
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
if (grdLIST.HeaderRow != null && grdLIST.HeaderRow.Cells != null)
{
for (int ct = 0; ct < grdLIST.HeaderRow.Cells.Count; ct++)
{
string headerText = grdLIST.HeaderRow.Cells[ct].Text;
if (grdLIST.HeaderRow.Cells[ct].HasControls())
{
if (grdLIST.HeaderRow.Cells[ct].Controls[0].GetType().ToString() == "System.Web.UI.WebControls.DataCountrlLinkButton")
{
headerText = ((LinkButton)grdLIST.HeaderRow.Cells[ct].Controls[0]).Text;
}
grdLIST.HeaderRow.Cells[ct].Controls.Clear();
}
grdLIST.HeaderRow.Cells[ct].Text = headerText;
}
}
if (grdLIST.FooterRow != null)
{
grdLIST.FooterRow.Visible = false;
}
grdLIST.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();
}
at grdLIST.RenderControl(htmlWrite);, I got that error. How can I solve it? Please help.
|
|
|
|
|
Hi,
If you look at your source code of your aspx page, you might be missing the following tag below the body tag.
(Your grid declaration should be in here)
Hope this solves your problem.
Regards,
Elizma
|
|
|
|
|
I do have that tag in aspx page coding. Anything else?
|
|
|
|
|
Hi I have a scenario in my aspx page. when I click on Rates Hyperlink in Rates.aspx page it should display all the countries alphabetical order.
The page looks like this:
A.. A B C D E F G..........X Y Z
Country .. withoutTax .. inclTax
Africa...... 12 ...... . .. 14
America..... . 13 .... ... .. 15
..
..
..
B.. A B C D E F G..........X Y Z
Country.. withoutTax .. InclTax
Barma ...... 12 ...... . .. 14
Bengal..... . 13 .... ... .. 15
..
..
I have one xml file called CountriesList.xml. It contains all the country names. I have to read only country names starting with A and display under A , like B,c....
How can I implement this? am using asp.net 2.0
please see the below link for your reference. I have to implement as it is.
http://www.skype.com/prices/callrates/[^]
Thanks
|
|
|
|
|
Assuming your xml schema looks something like this:
<br />
<countries><br />
<country><br />
<name>Africa</name><br />
<withoutTax>12</withoutTax><br />
<inclTax>14></inclTax><br />
</country><br />
</countries><br />
Load the xml into XmlDocument, create an Xsl file which defines how you want to format the output and accepts an argument named "firstLetter". Load the xsl file into an XslTransform object and call the transform method passing in the XmlDocument and a defined XsltArguments object which includes the letter selected by the user.
In your Xsl document use the "subtring" function to filter the output with an expression like this:
<xsl:template match="/"><br />
<table><br />
<tr><br />
<td>country</td><br />
<td>without tax</td><br />
<td>incl tax</td><br />
</tr><br />
<xsl:apply-templates select="//country[substring(name, 1,1) = $firstLetter]" /><br />
</table><br />
</xsl:template><br />
<br />
<xsl:template match="country"><br />
<tr><br />
<td><xsl:value-of select="name" /></td><br />
<td><xsl:value-of select="withoutTax" /></td><br />
<td><xsl:value-of select="inclTax" /></td><br />
</tr><br />
</xsl:template>
Where "firstLetter" is the argument passed to the stylesheet.
The output of the XslTransform.Transform method is your Html output for your page.
|
|
|
|
|
I am downloading an excel file to client PC using Response.writefile method. This method works fine if i open my page using window.open but its not working on modal window. can anybody help me in this regard?
Your help is appreciated.
saud
|
|
|
|
|
Hi lam satish,
Iam calling a web service which contains addition,subtraction,
multiplication,division methods. so these things, i have to call asynchronously using java script, with out post to the server.so give me reply as early as possible.
Thanks & Regards
satish.
|
|
|
|
|
Hi Satish,
I'm sorry, but I can't seem to find an actual question in there. Perhaps you could try rephrasing to make it more clear what, exactly, you are asking?
In the meantime, I'll assume that you are using the ASP.NET AJAX library and suggest that you head over to http://www.asp.net/ajax/documentation/live/[^] and scroll down to the Web Services section in the table. There are helpful write-ups on both how to expose web services to client script and how to invoke them.
Hope that helps a bit.
--Jesse "... the internet's just a big porn library with some useful articles stuck in." - Rob Rodi
|
|
|
|
|
The Prototype javascript framework[^] makes asychronous calls via javascript very easy. The documentation on their web site is quite good and you will also find plenty of examples with a quick search.
|
|
|
|
|
|
Dear All,
I would like to implement a horizontal drop down menu in asp.net ..but would like the use the in built menu control so that I will not use javascript.
However, I would like to be able to set a different style for each header in the menu. For example the home category may have a green border and some other html, the products category may have a blue border along with some html etc. What I need is to actually make a template for each of the categories.
Is this possible with the build in control? Any tips that might put me on the right track?
Thanks a lot,
Chris
|
|
|
|
|
Chris,
You can try creating a usercontrol. Create a usercontrol using all your appropriate styles. Later you can use this control in all your web pages by registering the user control in those pages!
gauthee
|
|
|
|
|
Hi Chris,
It sounds like you're going to be best served by looking into CSS Adapters, which allow you to override the rendering of ASP.NET controls. Scott Guthrie has a good overview [^] that may help you get started. Microsoft has also released some reference adapters[^] and a toolkit [^] that may prove helpful. A google[^] search for ASP.NET CSS Adapters will net you lots of hits.
Hope that helps.
--Jesse "... the internet's just a big porn library with some useful articles stuck in." - Rob Rodi
|
|
|
|
|
The asp.net menu control has a MenuItemDataBound event which allows you to access each menu item as the menu is being databound.
As this event triggers you can modify the properties of the menu item as you require.
protected void MainMenu_MenuItemDataBound(object sender, MenuEventArgs e)
{
MenuItem mi = e.Item;
mi.Text = .... do stuff here ...
}
|
|
|
|
|
Hi, I wrote this code for sending mail:
Dim message As New MailMessage()
message.Body = txtBody.Text
Dim mailAdrs As New MailAddress(txtEmailSender.Text, txtSender.Text)
message.From = mailAdrs
message.Subject = txtSubject.Text
Dim con As New SqlConnection()
con.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings("DrMasanConnectionString").ConnectionString
Dim com As New SqlCommand()
com.CommandText = "Select Email From [User]"
com.Connection = con
con.Open()
Dim reader As SqlDataReader = com.ExecuteReader()
While reader.Read()
message.To.Add(reader("Email"))
End While
Dim smtpC As New SmtpClient()
smtpC.Host = "drmasan.com"
smtpC.Send(message)
But this error appears:
No connection could be made because the target machine actively refused it 72.36.140.90:25
Why?
Best wishes
|
|
|
|
|
could be a port problem, check the port is allowing connection
|
|
|
|
|
I have two pages default page with two textbox and one button which when u click will take u to second page.
Second page with a button which will take u to default page. I have to get the text of textbox when I come back from second page to defaultpage using session
|
|
|
|
|
The easiest way to accomplish what you are looking to do, would be to put some code in the click handler of the button that is responsible for performing your redirection. In that code, you'll simply read the current value from your textbox and place it into Session .
In your default page's Load event handler, test for postback. If the current request is not a postback, attempt to read the textbox value from Session and restore it. The code to do so would look something like:
protected void Page_Load(object sender, EventArgs ea) { if ((!this.IsPostBack) && (!String.IsNullOrEmpty(Session["MY_DEFAULT_TEXTBOX_VALUE"])) { this.MyTextBox.Text = Session["MY_DEFAULT_TEXTBOX_VALUE"]; } } protected void Button_Click(object sender, EventArgs ea) { Session["MY_DEFAULT_TEXTBOX_VALUE"] = this.MyTextBox.Text; Response.Redirect("mysecondpage.aspx"); }
I'm assuming that you're performing your redirection from the server-side. I have also made the assumption that you are either not working in a web farm scenario, have IP affinity set, or are using SQL session management. If any of those are not the case, please note it and we can discuss some alternatives.
Hope that helps.
--Jesse "... the internet's just a big porn library with some useful articles stuck in." - Rob Rodi
|
|
|
|
|
When i wrote the code below it is giving syntax error in if statement saying ; expected .I am using c#.
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack )&&(!String.IsNullOrEmpty(Session["FirstName"])) && (!String.IsNullOrEmpty(Session["LastName"] ))
{
TextBox1.Text = Session["FirstName"].ToString();
TextBox2.Text = Session["LastName"].ToString();
}
}
protected void Button1_Click(object sender, EventArgs e)
{
Session["FirstName"] = TextBox1.Text.ToString ();
Session["LastName"] = TextBox2.Text.ToString ();
Response.Redirect("~/language.aspx" );
}
}
|
|
|
|
|
If you were to troubleshoot the compiler message, I suspect that you'd find that you are missing the enclosing parenthesis around the compound conditions of your if clause.
--Jesse "... the internet's just a big porn library with some useful articles stuck in." - Rob Rodi
|
|
|
|
|
It is saying invalid expression &&. In c# is it && using for 'and' operator or I have to write like
If(!IsPostBack && !String.IsNullOrEmpty(Session["FirstName"]) && !String.IsNullOrEmpty(Session["LastName"]))
Not closing each condition. Even if I write like this another syntax error
|
|
|
|
|
Just use Session["something"] = textbox.text to put the value in a asession and use it on a different page
|
|
|
|
|
i have two aspx pages , one form is child of another , if i am in the first form , can i programically , refresh the second one.
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
|
|
|
|
|
you can use this to refresh:
Response.AppendHeader("Refresh", "60;URL=Page.aspx");
or this
this might help you
|
|
|
|