Web Forms :: Code A Time Delay Before The Next Method Is Called?
Mar 13, 2011
How code a time delay before the next method is called? I have the following but I don't think it's waiting 10 seconds before calling CallMethod(). Thread.Sleep(10000); CallMethod();
View 2 Replies
Similar Messages:
Jun 29, 2010
I want to use a function in the code file of ASP.NET such that everytime the function is called, its value increases by 1.I thought of a way but it didn't fully work out. I created a class for this and used a static variable in that but the lifetime of static variable in asp.net is till the time the app does not close.
public class Class1
{
public Class1()[code]....
View 11 Replies
Jul 27, 2012
l Im downloading Pdfs using WebClient I used below code
try {
WebClient wc = new WebClient();
Uri uriadd = new Uri(@"ftp://xxx.yyy..../httpdocs/FH/Foldername/" + clientorder1[i].Cloi_id + ".pdf");
wc.Credentials = new NetworkCredential("xxxx", "zzzz");
}
Its working fineĀ but some times Gives Error like Object synchronization method was called from an unsynchronized block of code.. Why this Error coming ....
View 1 Replies
Aug 2, 2010
I am using Asp.net menu control, how can I delay the showing of sub menu items ?
View 7 Replies
Apr 13, 2010
I am creating an Asp.net web site which will support dynamic data. When I am creating a dynamic web site from Scratch (from template in VS) all is working fine. But when I am trying to add dynamic entity (.edmx) file and running the application I am getting following error
"The method 'Skip' is only supported for sorted input in LINQ to Entities. The method 'OrderBy' must be called before the method 'Skip'. "
View 2 Replies
Jun 11, 2010
Every time my VB .NET Web Service is idle for about 30 minutes or more, the response for the next request is very slow.
View 2 Replies
May 7, 2015
I have used Modal Popup Extender control to popup an enquiry form onpage load.
I want that if user remains on current page for atleast 1 minute, then Modal popup Extender should get poped up after 1 min.
View 1 Replies
Sep 7, 2010
I can't understand why the method LoadViewState() is not called after the postback in my code below.After label1 cahnges its text the "__VIEWSTATE" hidden field is modified, but LoadViewState() is not called.
[Code]....
View 3 Replies
Feb 1, 2010
I'm debugging right now and it seems the Wizard.ActiveStepChanged method is called BEFORE the Page_Init method?!?
I've tried it several times now.
If thats the case: what is called BEFORE Wizard.ActiveStepChanged?
View 3 Replies
Aug 24, 2010
Maybe this belongs in vb script forum, not sure ....
Anyway, I have an application that is running a ftp script. The code works fine but following is happening:
I my code I intend to show an message box when the ftp process is complete. What is happening is that the message box is being shown before the ftp is complete (while the dos window is up). Is there a way to delay continue running code till ftp is complete or wait for a number of seconds?
Here is the code snippet for the ftp process:
[Code]....
View 2 Replies
Feb 22, 2011
Using Forms authentication, for some reason my login page is called 9 times. it causes some browsers to show "too many redirects!". Even with no javascript and nothing in the page_load event, it is called 9 times.
View 2 Replies
Mar 10, 2010
I am having a problem with getting a listbox to update after the add method is called. I am using an AsyncFileUpload control and as part of the AsyncFileUpload1_UploadedComplete I am creating a listItem and then adding that to the listbox. The item will not appear in the listbox. I have tried putting the listbox in an update panel and then calling the Update method on the panel from within the AsyncFileUpload1_UploadedComplete procedure and that too fails to update the listbox. I can call the Update method on the panel from a separate procedure and still the listbox will not update with the item added in the AsyncFileUpload1_UploadedComplete method.
View 6 Replies
Jul 2, 2010
Below is my code, where the ajaxStop() method is not called.
[Code]....
[Code]....
View 1 Replies
Mar 9, 2010
I have a controller method that returns a jSON object and in one calling situation, it works and in another calling situation, it does not work. When the URL in my browser is this:
http://localhost:65247/Client -- it works.
But, when my url looks like this:
http://localhost:65247/Client/UserAdmin?id=6 -- it DOES NOT work
In a nutshell, clients have users. From within the client, I wish to work on a specific user (this is the UserAdmin view). In this case, the client id is 6. From within the UserAdmin view that was launched with Id=6, I then wish to select a user from a dropdown. The idea was to use javascript and $.getJSON to fetch data for the specific user so as not to have to refresh the entire page. I use this approach in other parts of the app. The only difference I can see is with the URL in the browser. It would appear the presence of parameters via the '?' is futzing things up a bit.
View 1 Replies
Jul 6, 2010
I'm overriding the Controller.Initialize method to set some stuff before each ActionResult is executed, however I'm finding that the method is being called multiple times for each request (anywhere between 2 - 10 times). I'm running in Cassini.
My hunch is that it is running for all static files (images, css etc) as well as the requested action - although I may be wrong? I thought maybe something was wrong in my web.config but it all looks right to me.
View 6 Replies
Mar 3, 2011
In one view (view1) there is a text box and a button beside it. i click on that button, i am popping another view (Create view) as a seperate window. in create view i am entering some values and creating a record in db. out of these values one value i have to send back to "View1". how can i send this value? i am opening view2 from view1 like
<input type="button" value="Get ID"
onclick="window.open('<%=Url.Action("Create","Controller1") %>',
'','scrollbars=yes,width=800,height=800,resizable=yes');"
/>
View2 contains some fields like Name,Email etc... and I click "Create" to call HTTPPOST. there i add the values to db including a generated guid. i want to send this ID to view1.
View 2 Replies
Feb 4, 2010
I'm rewriting a Web Forms application as an exercise to learn some MVC skills.I have a number of LinkButtons on the original application which postback and raise a serverside event that rebinds data to a datagrid.
E.g.
Event handlers:
protected void lbtnOffset0_Click(object sender, EventArgs e)
{
[code]....
What I currently have in MVC is this:
<%= Html.ActionLink("CurrentYr", "Index", 0)%>
<%= Html.ActionLink("1", "Index", 1)%>
and
public ActionResult Index()
{
return View(MietController.GetMietByYearOffset(0);
[code]...
As the ActionLink renders an tag it doesn't postback so my overloaded Index() method isn't called. What are my options for doing this in MVC?
View 1 Replies
Nov 11, 2010
When trying to edit the word before the delimiter the service method is not even called in IE but works fine in Chrome.
As an example, while '$' is set as a delimiter;
$csAux.Value$csNeedsPO.Valu
Now, editting the word
csNeedsPO => the autocomplete populates as expected succesfully.
csAux.Value => doesnT trigger the method in the background.
View 1 Replies
Jul 30, 2010
Web application initialization is as follows:
As we know when IIS receives the first request for a particular Asp.net application resource, IIS creates an instance of a HttpApplication (defined in global.asax codebehind).When this new instance is created it's initialization happens that also checks all configured HTTP modules.All modules are then instantiated and put in the application's Modules collection (of type HttpModuleCollection)modules are looped through and their Init() method is called (when they register for request events)
As far as I understand it the above scenario happens when a web application is started/initialized (hence application start event).What happens with modules?
Are they (re)instatiated on each request or reused from the Modules property on each consecutive request while the web application is alive? As I understand IIS and Asp.net they are reused through the whole life of a web application.
If they are reused, can we assume that their Init() method is actually a pseudo event handler for application start event? The thing is we can't attach to application level events within http modules. But if they are being reused we could use Init() as application start event and do whatever we'd put in global.asax instead.
Question,Can we assume that module's Init() method is called only on application start event? Could we use this assumption to i.e. register routes for applications whose global.asax codebehind we can't change? web.config is usually accessible and we can change it the way we want.Would this actually work?
Additional info,We can check HttpApplication code and check its InitModulesCommon() method. This one actually calls Init() of each registered HTTP module. What is more interesting is that this method is only used by InitIntegratedModules() and InitModules() methods. Which are both used only in HttpApplication.InitInternal() method. This is the basis of my assumptions, but I would like to know whether someone has abused IHttpModule.Init() for application start event.
View 3 Replies
Jul 23, 2010
I have a javascript library and in there i have a method that is called from my view. Here it is:
<li><a href="javascript:void 0" onclick="deleteAll('image', '<%= ViewData["FileGroupId"]%>')"><div><%=GetGlobalResourceObject("default", "Delete_all") %></div><div></div></a></li>
and here is my js code in the javascript library:
var deleteAll = function(module, groupId) {
jConfirm(_deleteConfirmAll, _deleteAll, function(r) {
if (r) {
showProgress();
$.ajax({
cache: false,
type: "POST",
url: _baseUrl + "/" + module + "/deleteall/" + groupId,
success: function(msg) {
if (msg == '0') {
location.href = _baseUrl + '/' + module;
}
else {
jAlert(msg, _errorTitle);
}
hideProgress();
}
});
}
});
}
My problem is that i cant reach my controller. Here is my controller code:
#region common methods
List<.CMS.Core.File> GetList(int groupId)
{
List<CMS.Core.File> list = new List<CMS.Core.File>();
CMS.Core.FileFilter filter = new CMS.Core.FileFilter();
filter.GroupId = groupId;
int res = CMS.Core.File.Search(_connection, filter, ref list);
return list;
}
#endregion
public ActionResult DeleteAll(int groupId)
{
List<CMS.Core.File> list = GetList(groupId);
foreach (File item in list)
{
item.Delete();
}
return Json(list);
}
And at last her is my Index method
public ActionResult Index(int? id)
{
if (Request.IsAjaxRequest())
{
JsonPaging paging = new JsonPaging();
int offset = 0;
int page = 0;
if (!String.IsNullOrEmpty(Request.QueryString["page"]))
{
Int32.TryParse(Request.QueryString["page"], out page);
}
if (page > 0)
{
offset = (page * paging.PageSize) - paging.PageSize;
}
FileFilter filter = new FileFilter();
filter.Deleted = false;
filter.MaxRecords = paging.PageSize;
filter.Offset = offset;
if (!String.IsNullOrEmpty(Request.QueryString["keywords"]))
{
filter.FilterType = FilterTypes.AND;
filter.Name = Request.QueryString["keywords"].ToString();
}
if (!String.IsNullOrEmpty(Request.QueryString["sort"]))
{
filter.OrderBy = Request.QueryString["sort"].ToString();
if (!String.IsNullOrEmpty(Request.QueryString["direction"]))
{
filter.OrderBy = filter.OrderBy + " " + Request.QueryString["direction"].ToString();
}
}
if (id > 0)
{
filter.GroupId = id.Value;
}
List<CMS.Core.File> items = new List<CMS.Core.File>();
int results = CMS.Core.File.Search(_connection, filter, ref items);
foreach (CMS.Core.File current in items)
{
JsonItem item = new JsonItem();
item.Id = current.Id;
item.Name = current.Name;
item.ImageText = current.ImageText;
item.Aperture = current.Aperture;
item.TakenOn = current.TakenOn;
item.Camera = current.Camera;
item.ExposureTime = current.ExposureTime;
item.FocalLenght = current.FocalLenght;
item.Tags = current.Tags;
item.Url = current.Url;
item["Active"] = current.Active.ToString();
item["Created"] = current.Created.ToString();
paging.Items.Add(item);
}
return Json(paging, JsonRequestBehavior.AllowGet);
}
else
{
ViewData["FileGroupId"] = id;
return View();
}
}
View 2 Replies
Nov 25, 2010
Can a required field validator be called from the code behind page?We have several check boxes and some of them require the user to enter a date, but not all of them.(This is not a checkbox list, but individual checkboxes).Any 1 of 6 different checkboxes selected makes a txtBox visible for users to enter a date.If they don't select one of these checkBoxes which require a date - it doesn't matter, the form will still be valid.I don't think validation groups can work here so looking towards doing through .vbHere's the existing code:
Public
Sub chkBoxI_CheckedChanged(ByVal sender
As
[code]...
View 3 Replies
Jan 28, 2010
I run a site with decent traffic (~100,000 page views per day) and sporadically the site has been brought to its knees due to SQL Server timeout errors.When I run SQL Profiler, I see a command getting called hundreds of times a second like this:
exec dbo.TempGetStateItemExclusive3 @id=N'ilooyuja4bnzodienj3idpni4ed2081b',...
We use SQL Server to store ASP.NET session state. The above is the stored procedure called to grab the session state for a given session. It seems to be looping, asking for the same 2 or 3 sessions over and over. I found a promising looking hot fix that seems to address this exact situation, but it doesn't seem to have solved the problem for us. (I'm assuming this hotfix is included in the most recent .NET service pack, because it doesn't look like you can install it directly anymore). I added that registry key manually, but we still see the looping stored procedure calls like above (requesting the same session much more often than every 500ms) I haven't been able to recreate this on a development machine. When two requests are made for the same session ID, it seems to block correctly, and even try to hit SQL until the first page releases the session.
View 3 Replies
Feb 10, 2010
I want to unit test my rendering engine for an ASP.NET app. I have some custom controls created in that app. Most of those control rely on having CreateChildControls() method called by the ASP.Net engine wheather during initial call or a postback.When running a test CreateChildControls() does not get called and the control is in an "invalid" state.
As a workaround to get the tests going I explicitly call some other public method that calls EnsureChildControls() in it. This in effect causes CreateChildControls() to be executed and the control being initialized properly (just as it would normally when hosted on web server). I would like to get rid of that extra method call and the control to still be in a proper state for testing.
View 1 Replies
Jul 18, 2012
I am working on a really old site and the following line is causing an error
Code:
Dim newFile As FileStream = New FileStream(Server.MapPath(sSavePath + sFilename), System.IO.FileMode.Create, System.IO.FileShare.ReadWrite)
View 6 Replies
Aug 11, 2010
In my office I am the only Web Developer. There are no other Web Developer.
I was confused by my co-worker programmers regarding the meaning of Code Behind. They told me there is no such Code Behind.
highlight which is CodeBehind from these 2 sets of sample coding:
these are from HTML
[code]....
Of the 2 sets of sample cpding which one is called CodeBehind ?
View 2 Replies