How do I call a client script function from a server side button click(with submit behaviour set to false) .
protected void Button4_Click(object sender, EventArgs e)
{
//System.Threading.Thread.Sleep(2000);
lbDateTime.Text=System.DateTime.Now.ToString();
ClientScript.RegisterClientScriptBlock(this.GetType(),"success","saveSu...
I want to get the current width of an html form using javascript. I'm writing this in asp.net
Form definition: <form id="form1" runat="server">
What I an trying: document.getElementById('form1').style.width
Keep producing a runtime error... Any ideas?
Thanks!
...
I have tested my pages in Firefox & IE and looking at Firebug in Firefox for some reason some images are taking a long time to load. They are not very big in comparison to the ones which are loading quicker.
Attached is a screenshot of Firebug.
I especially notice it in IE with the progress bar at the bottom of the page, it just sits ...
Hello All,
I have a great problem and I don't know how to solve it
I have created a web application and host it in USA server , and the users who access this web application from Egypt
The problem that i'm using DateTime.Now method inside the application and this method return the time of USA server not the time of the machine that us...
Hi there
I started learning ASP.NET these days. Google Chrome is my default browser and I'm also testing my applications in Google Chrome.
I recognized that some Elements of ASP.NET won't run in real time when I use Chrome. For Example ASP.NET WebParts. If I change the modus of the WebPartManager from default to edit (or something else...
Hi,
I have an Index view. On this view is a link, and it is created like this:
<%= Html.ActionLink("Clear All", "ClearAll", "CachedCollections") %>
I don't want to have a view for ClearAll, I just want it to go in the method, clear what it needs to clear and then post back to the Index view. How would I do this? Do I need to call ...
Hello All,
How can I add and read value from web.config
Thanks in Advance
...
I have created a class called BasePage which inherits System.Web.UI.Page. On this page I've declared a property called UserSession which I want to be able to access from any Page/MasterPage.
public class BasePage : System.Web.UI.Page
{
string UserSession { get; set; }
public BasePage()
{
base.PreInit += new EventHa...
How to remove all endRequest handlers in PageRequestManager?
...
Using this code for authentification:
HttpContext.Current.User=new GenericPrincipal
(new GenericIdentity(user.UserName), roles);
FormsAuthentication.SetAuthCookie(user.UserName,false);
Problem is - on next request, HttpContext.Current.User.IsAuthenticated is true, but HttpContext.Current.User.IsInRole("admin") is false.
There are a...
How to display yahoo static map in gridview if we pass address as query string? Also please tell how to display dynamic yahoo maps also. I have searched about yahoo maps and got the following links http://developer.yahoo.com/flash/maps/examples.html, http://developer.yahoo.com/maps/rest/V1/ and http://developer.yahoo.com/maps/. I did not...
My Visual Studio debugger detaches every time when I try to access a property in a web application. I don't use Visual Studio's inner webserver, just the standard IIS. It seems like that property has somewhere a stack overflow
(Server Application Unavailable)
, but I can't find it. There is an error message in the EventLog:
as...
While searching for authentication ,i found above two line written .what it means? please tell me.
...
Hello everybody,
I have this in my global.asax
void Application_BeginRequest(object sender, EventArgs e)
{
string pathAndQuery = Request.Url.PathAndQuery.ToString().ToLower();
if (pathAndQuery.Contains("prettyUrl"))
{
HttpContext.Current.RewritePath("Category.aspx?catg=uglyUrl");
}
}
it works fine, but I some...
Hey,
Before I start to write my problem, I will excuse for my bad English and I hope you can understand me.
I have in a ASP.NET Webapplication an AJAX Updatepanel. In this Updatepanel is a
Textbox for dynamic search results. When I start to write in the Textbox, the results comes like Google suggest.
Now, the focus must be always on th...
I have a ASP.NET 4.0 web application that uses System.Web.Routing.RouteTable for some routing. In my global.asax I have this code:
protected void Application_Start(object sender, EventArgs e)
{
RouteTable.Routes.Add(new Route("", new PageRouteHandler("~/Documentation/Index.aspx")));
}
The application resides in a virtual directory...
I've just set up a small R&D MVC2 project, and I've basically used only the wizards to add a partial view for my Customer object, which as a Linq to SQL entity. When I try and visit the Create view for Customer, I get the following error on the RenderPartial method in the Create view:
Compiler Error Message: CS1502: The best overloaded...
I am planning to create an ecommerce application which would host a lot of products (more than 100) and expectedly would have good number of user hits/transactions on a daily basis.
My major requirements from both functional and technical point of view are:
It should be easily extensible/modifiable/maintainable.
Usability would be the ...
is it ok to use something like this in the web:
(my application is on asp.net mvc)
public static class DbUtil
{
public static int Insert(object o, string cs)
{
using (var conn = new SqlConnection(cs))
using (var cmd = conn.CreateCommand())
{
...
conn.Open...
Hi,
I am using javascript to validate user input on my aspx page. I am easily able to validate textboxes and dropdown list for differenet scenarios.
Now, on one of my dropdown lists (for country), I need to check if it is an allowed country or not for a particular service. I have stored the valid country list in a static property. Is ...