|
if (Session["userid"] != null)
{
}
else
{
}
Raju.M
|
|
|
|
|
Let an attribute do that for you - that's what they are there for! Read the docs and i should get you started.
me, me, me
"The dinosaurs became extinct because they didn't have a space program. And if we become extinct because we don't have a space program, it'll serve us right!"
Larry Niven
nils illegitimus carborundum
|
|
|
|
|
hello,
my name is ankur sharma.
I want to create a fusion chart from xml and want to show in swf format using asp.net.
how to achieve it.
Plz guide me
Thanks
|
|
|
|
|
You need to read following guide for creating xml file
from your data.
Fusion Charts[^]
Give this xml file/string to the fusion chart function to generate
and render the charts. The guide will help you to do so.
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
|
hi iam using asp.net with c#
in my application when user login successfully,then in the next page based on the client database i have to display data in a grid view ,
so how to give connection string in asp.net with c#
can you correct my code which helps me
protected void Page_Load(object sender, EventArgs e)
{
string strHostName = System.Net.Dns.GetHostName();
string clientIPAddress = System.Net.Dns.GetHostAddresses(strHostName).GetValue(0).ToString();
string strcon = "Data Source=";
strcon += clientIPAddress+";" + "Initial Catalog=POS;Trusted_connection=true";
SqlConnection con = new SqlConnection(strcon);
SqlCommand cmd = new SqlCommand("select * from AllTransactions where BranchKey=" + Convert.ToInt32(Session["BranchKey"]) + "", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds, "tt");
GridView1.DataSource = ds.Tables["tt"];
GridView1.DataBind();
}
the data is displaying in my system but when client logins it is showing no record, can you correct my code
|
|
|
|
|
I am not able to understand why and how
you need to access client side database.
But for getting client IP
Use this..
Request.ServerVariables("REMOTE_ADDR")
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
|
hi to all,
i have added texbox dynamically which is located at modalpopup i want to do validation for that textbox how can i do that//
plz tell me...
thanks
|
|
|
|
|
|
Hi
How to send sms to any mobile no. by web application in asp.net on click of button and automatically on particular date.
thanks
You get the best out of others when you give the best of yourself.
|
|
|
|
|
Look here[^]
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
|
|
I'm getting a weird error. I have a css class and I dragged the reference onto the aspx.
The compile-time page is recognizing the reference to the styles in the css because when I remove the css reference from the aspx the page displays squiggly lines under the CssClass references with a tooltip "cannot be found".
However, when I run the page the css classes aren't getting applied.
Also weird - when I copy the css class definitions from the css file into a tag in the <head> variable of my page the css classes DO get applied.
I can't figure out why my css classes aren't getting applied at runtime even though the references appear to check out at compile time. Any ideas?
|
|
|
|
|
Have you checked the url of css file in the generated page source. It seems to me that the path of the css file is incorrect.
Try using ResolveClientUrl to set the css url.
<%=ResolveClientUrl("~/css/default.css")%>
WWW, WCF, WWF, WPF, WFC .... WTF
|
|
|
|
|
Member 3919049 wrote: I can't figure out why my css classes aren't getting applied at runtime even though the references appear to check out at compile time.
At times, it happen that it is fine during compile time but when you publish it, the path is little different and thus you code is unable to refer it. Looks like the same with you.
Using viewsource of page, check where is the stylesheet being referred. Is the location correct based on your project hierarchy.
If you are unable to resolve the path in deisgner, you can check the value of it on server side, using the same URL.
You can also, set the URL of CSS via codebehind. Refer: Resolving Paths in a Multi-Folder WebSite[^]
|
|
|
|
|
Hi,
Have you ever tried to refresh the page , sometimes the css + js files are cached, Ctrl + F5 could help
i faced this issue when trying to add new css classes to the stylesheet file and fixed it by refreshing the page
Regards,
Jamil
|
|
|
|
|
I am working with a page which needs to change it's language by user decission, so I created the Local Resources and I want link the language to an imageButton with the country flag, and I change the Culture data inside the button click event and overrides the InitializeCulture Method, and it works, but because InitilizeCulture executes before than the click event it needs two clicks for getting the page change, my InitializeCulture method contains the following sentences:
protected override void InitializeCulture()
{
if (Session["Cultura"] != null)
{
Cultura = (string)Session["Cultura"];
UICulture = Cultura;
if (Cultura == "es") Culture = "es-ES";
Thread.CurrentThread.CurrentUICulture = new CultureInfo(Cultura);
}
base.InitializeCulture();
}
What I need to introduce in order to avoid the double click, because the execution order normally is InitializeCulture - Page_Load - Button_click, and if I directly call the InitializeCulture from the Button_Click it doesn't refresh th screen.
Best Regards
|
|
|
|
|
A simple hack would be to redirect back to the same page in the click handler.
|
|
|
|
|
I don`t understand your meaning for "a simple hack" but my problem is that InitializeCulture executes before than Button_click so the first click on the button first execute the InitializeCulture before the culture has changed (Session["Culture"]) and the second click just really change the page, but how to do it in only one click.
|
|
|
|
|
Hi,
i propose to move the code that update the Session["Cultura"] to code block of Button_Click and let the InitializeCulture() do it is job by setting the CurrentUICulture.
Regards,
Jamil
|
|
|
|
|
Hi,
I am new to C# and I have a LinkButton inside a gridview. I have been trying to set the myLinkButton.Visible property true or false depending on a database entry.
Here is the code behind I have been working on:
protected void gvBalance_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
LinkButton MyButton = (LinkButton)e.Row.FindControl("lbPayStatement");
if (Status.Text == "PaymentType1")
{
MyButton.Enabled = false;
}
else
{
MyButton.Enabled = true;
}
}
It gives me errors:
'System.Web.UI.WebControls.GridViewCommandEventArgs.Row' is inaccessible due to its protection level
The property or indexer 'System.Web.UI.WebControls.GridViewCommandEventArgs.Row' cannot be used in this context because the get accessor is inaccessible
I tried making the method "public" and so on , it didn't help. What am I doing wrong? Is there an easier way to access a LinkButton "id" inside a gridview?
Thanks in advance.
~Kaan
|
|
|
|
|
mtataric wrote: gvBalance_RowCommand
Please check which event you are using to do so.
If Gridview then RowDataBound and if DataGrid then ItemDataBound event is the one where you need to write your code to get the link button and then set it's visibility based on certain conditions.
|
|
|
|
|