|
i have hosted two applications under one site and both are running perfectly on single port.
So that i raised this question. But, if i tried to created separately i doesn't supported.
excellent answer from you friend.
Thanx.
|
|
|
|
|
Hi Friend, Please Help me,
I have two dropdownlists and two nested GridViews. In first dropdwnlist continents and second countries. I want to bound two GridView into GridView. In first GridView i want to States and second GridView i want fill District. When i select continents in first dropdwnlist then second dropdwnlist fill that countries. When i select second dropdwnlist's countries, then how to fill nested GridView States and Districts. Can I do it in ASP.NET C#. Please Help me.
My E-Mail ID- bharat.garande@gmail.com
|
|
|
|
|
Yes you can bind the state gridview and district gridview on the RowDatabound event.
check the selected value of DropdownList 1 value and DropdownList 2 value and then find the child gridview and bind the datasource..
|
|
|
|
|
HI,
I am facing an issue , from my client side (HTTPS browser) I am trying to connect a HttpTaskAsyncHandler in the project
Eg:
var webSockets = new WebSocket("wss://xxx.com//Racer.HTML5/WSHandlerCall));
if (webSockets != null) {
webSockets.onopen = function () {
alert('Connection open');
}
1.The sockets send a request.
2. OnOpen Listener is triggered but not called the handler.
Plz Help !!
|
|
|
|
|
I don't know if this was just a typo when you posted, but you are missing the closing "
var webSockets = new WebSocket("wss://xxx.com//Racer.HTML5/WSHandlerCall));
should be
var webSockets = new WebSocket("wss://xxx.com//Racer.HTML5/WSHandlerCall");
|
|
|
|
|
[^]
Note sure if this helps:
"We can only use .NET WebSocket on Windows 8, Windows Server 2012 and above, including both server-side and client-side applications. And the web server must be IIS 8 and above. IIS 8 Express which is also packaged in Visual Studio 2012 does NOT support WebSocket at present. "
|
|
|
|
|
I have done performance testing for our web application for 500 concurrent users which results on 100% CPU Utilization on database server. Also the number of connections exceeds to 500-600 connections.
Because of this Performance testing got failed with 500 - Internal Server error.
Is there any way to reduce the number of connections for 1000+ concurrent users.
Please help on this.
|
|
|
|
|
First of all - 100% CPU usage tells nothing about performance. You have to measure response time, not hardware utilization...
You should check how many request failed with HTTP 500. It may not be connected to the DB connections, and anyway not all of them should fail even if DB is overloaded...
Try using connection pooling - http://msdn.microsoft.com/en-us/library/8xx3tyca.aspx[^]
(We running web site with few thousand concurrent users and no DB problem)
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
Along with connection pooling, make sure in your application that you close your connection to the database as soon as you are done with it.
|
|
|
|
|
In webconfig, i have set pool size and connect timeout as 0.
Also am closing the connections once over.
Though am receiving sleeping connections as 150.
Using below code for connection
DataSet dataset = new DataSet();
SqlConnection con = new SqlConnection(GetConnectionString());
con.Open();
SqlCommand cmd = new SqlCommand(storedProc, con);
cmd.CommandTimeout = Convert.ToInt32(GetCommandTimeout());
cmd.Parameters.Add(new SqlParameter("@AssociateId", SqlDbType.Int)).Value = AssociateId;
SqlDataAdapter da = new SqlDataAdapter(cmd);
cmd.CommandType = CommandType.StoredProcedure;
da.Fill(dataset);
con.Close();
return dataset;
|
|
|
|
|
That code will close the connection if it succeeds. If any part of the code throws an exception, however, the connection will remain open.
Both the SqlConnection and SqlCommand classes implement the IDisposable interface. Whenever you create something that implements IDisposable , use it within a single method, and then throw it away, you should wrap it in a using block to ensure that the Dispose method is always called.
Also, since you're using a data adapter, you don't need to explicitly open and close the connection; the data adapter will take care of that for you.
using (SqlConnection con = new SqlConnection(GetConnectionString()))
using (SqlCommand cmd = new SqlCommand(storedProc, con))
{
cmd.CommandTimeout = Convert.ToInt32(GetCommandTimeout());
cmd.Parameters.Add(new SqlParameter("@AssociateId", SqlDbType.Int)).Value = AssociateId;
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet dataset = new DataSet();
da.Fill(dataset);
return dataset;
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks richard for your suggestion
|
|
|
|
|
Hi,
I want to use ajax tabcontainer in asp.net mvc 4.
I found out that the AJAX Control Toolkit controls are server controls and are not supported in ASP.NET MVC. But I want to use it. So please guide to me how can I use tabcontainer with other ways like ajax tabcontainer.
Thanks in advance , sir.
modified 14-Jul-14 7:11am.
|
|
|
|
|
|
Hi,
I need to do authorization for files in a particular folder. For example:: i am storing files in the folder named "Report" and if some is not authenticated he must not able to view the particular resource(http://localhost:82/Report/manager.pdf) and It must redirect to lo-gin page (http://localhost:82/Account/Login.aspx). This is working fine in with the site configured Application pools with integrated mode(Managed pipeline mode) , But in classic mode with out Authentication i can access the files directly(http://localhost:82/Report/manager.pdf) that must be restricted. The web.config is attached below.Can some one help to resolve this issue.
----Web.config------
<configuration>
<connectionStrings>
<add name="ApplicationServices"
connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true"
providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<authentication mode="Forms">
<forms loginUrl="~/Account/Login.aspx" timeout="2880" />
</authentication>
<authorization>
<deny users="?" />
</authorization>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
Regards,
sajith
|
|
|
|
|
|
Thank-you very much Richard Deeming , Your comment was very helpfull
|
|
|
|
|
Hello.
I am trying to build an event calendar using ASP.net for my organization. The article I used for reference is AJAX Event Calendar (Scheduler) for ASP.NET MVC in 80 Lines of Code[^]
I have followed the instructions to the letter but I keep getting an error:
Error 1 The type or namespace name 'Event' could not be found (are you missing a using directive or an assembly reference?
What am I doing wrong?
Here are the code blocks of my application:
1)Index
@{ ViewBag.Title = "AJAX Monthly Event Calendar for ASP.NET MVC"; }
<h2>ADE R and T Event Calendar</h2>
<script src="@Url.Content("~/Scripts/DayPilot/daypilot-all.min.js")" type="text/javascript"></script>
@Html.DayPilotMonth("dp", new DayPilotMonthConfig
{
BackendUrl = Url.Content("~/Home/Backend"),
EventMoveHandling = DayPilot.Web.Mvc.Events.Month.EventMoveHandlingType.CallBack,
EventResizeHandling = DayPilot.Web.Mvc.Events.Month.EventResizeHandlingType.CallBack,
TimeRangeSelectedHandling = DayPilot.Web.Mvc.Events.Month.TimeRangeSelectedHandlingType.JavaScript,
TimeRangeSelectedJavaScript = "dp.timeRangeSelectedCallBack(start, end, { name: prompt('New Event Name:', 'New Event') });"
})
2) HomeController.CS
using System;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using DayPilot.Web.Mvc;
using DayPilot.Web.Mvc.Events.Month;
namespace Calendar1.Controllers
{
public class HomeController : Controller
{
public ActionResult Index()
{
return View();
}
public ActionResult Backend()
{
return new Dpm().CallBack(this);
}
class Dpm : DayPilotMonth
{
protected override void OnInit(InitArgs e)
{
var dbo = new DataClasses1DataContext();
Events = from ev in dbo.events select ev;
DataIdField = "EventID";
DataTextField = "EventText";
DataStartField = "EventStart";
DataEndField = "EventEnd";
Update();
}
protected override void OnEventMove(EventMoveArgs e)
{
var dbo = new DataClasses1DataContext();
Events = from ev in dbo.events select ev;
var toBeResized = (from ev in dbo.events where ev.EventID == Convert.ToInt32(e.Id) select ev).First();
toBeResized.EventStart = e.NewStart;
toBeResized.EventEnd = e.NewEnd;
dbo.SubmitChanges();
Update();
}
protected override void OnEventResize(EventResizeArgs e)
{
var dbo = new DataClasses1DataContext();
Events = from ev in dbo.events select ev;
var toBeResized = (from ev in dbo.events where ev.EventID == Convert.ToInt32(e.Id) select ev).First();
toBeResized.EventStart = e.NewStart;
toBeResized.EventEnd = e.NewEnd;
dbo.SubmitChanges();
Update();
}
protected override void OnTimeRangeSelected(TimeRangeSelectedArgs e)
{
var dbo = new DataClasses1DataContext();
Events = from ev in dbo.events select ev;
var toBeCreated = new Event { EventStart = e.Start, EventEnd = e.End, text = (string)e.Data["name"] };
dbo.events.InsertOnSubmit(toBeCreated);
dbo.SubmitChanges();
Update();
}
public object toBeCreated { get; set; }
}
}
}
3) Web.config
="1.0"
<configuration>
<configSections>
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
</sectionGroup>
</configSections>
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<namespaces>
<add namespace="DayPilot.Web.Mvc"/>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Optimization"/>
<add namespace="System.Web.Routing" />
<add namespace="Calendar1" />
</namespaces>
</pages>
</system.web.webPages.razor>
<appSettings>
<add key="webpages:Enabled" value="false" />
</appSettings>
<system.webServer>
<handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
</handlers>
</system.webServer>
</configuration>
I am using Visual Studio 2013. Are there any changes I need to make to the code? Most of it I copy-pasted from the article used for reference.
I apologize if the question is too long. Thanks in advance!
Please let me know what I am doin
|
|
|
|
|
i hard the term Katna but do not know what it it & what it's usage in .net ? so please some one briefly discuss what is it and when one should use it and also advantages too. please do not redirect me to www.asp.net web site
thanks
tbhattacharjee
|
|
|
|
|
|
|
OWIN ( initials for Open Web Interface for .NET )is a set of specifications that defines a stardand interface between which .NET web servers and web applications communicates. Katana on the hand is an implementation of the OWIN.
Praveen
|
|
|
|
|
Hi,
I have a web service.
In certain scenarios, I want to send specific status Codes back to the client.
I tried using the context.Response.statusCode but it doesn't work.
Anyone knows how can I accomplish that?
|
|
|
|
|
Always include the relevant code in your question.
ThetaClear wrote: I tried using the context.Response.statusCode but it doesn't work. how? you got any error? debug it. Update your question with error details.
|
|
|
|
|
I just wrote something like that:
Context.Response.StatusCode = 422;
and expected to get 422 on the client but I got 200
|
|
|
|