|
Hi I am using IE11, when my page runs it throws the error like below..please suggest..It runs fine in other broswers..
IE 11 giving XML5619: Incorrect document syntax
|
|
|
|
|
Set the content-type of you're request to text/xml and try.
modified 20-Sep-20 21:01pm.
|
|
|
|
|
Hi Friends,
I need your help.
Recently i got assignment to work on MVC based project.
Now i am well familiar with Traditional ASP.NET Web Forms & how it works..but not that much with MVC. So i need your general/overall guidance.
Consider a situation that i need to build internet based site wherein
a- Customer fills-in Registration page
b- Later when Admin logs-in the site, Admin can see List of Pending requests in the grid.
consider having columns like FirstName, LastName, Address, City, State in the Grid. First column in grid will have Image-with-Hyperlink
c If admin clicks on any record, again Registration page will open, admin can see details filled-in by user. Here admin can perform any of below 3 activities.
c1- Admin can modify any of these details & add few notes/comments, via Submit-Button.
c2- Admin can Approve request, via Submit-Button.
c3- Admin can Reject request, via Submit-Button.
After performing any of 3 above action, screen will go back to Pending-Request-Grid.
Approved/Rejected User will Not be shown in this grid.
d- Now Approved User will get shown into another grid call Manager Users.
Manage-User-Grid will have same info as Pending-Request-Grid, but here Image-Hyperlink will allow admin to disable a user Or will allow Edit user info.
Now considering above situation, i tried started developing MVC 5 based Web Application Project but i see that lot of features are coming into picture e.g. Partial-View, ViewModel, Entity Framework, Linq.
So it happens that, to complete Task-A, i implement one feature e.g. LINQ and after sometime, to complete Task-B, i got another article which show using Entity Framework. So again i need to create Few Classes, Delete Few Classes, Delete some code...
This kind of thigns takes more time & lot of times...working things get stopped.
I want to use below features in this project:
Entity Framekwork, Partial View, Strogly Typed View, Stored Procedure base Data Read/Modify
So what i want from you:
Q-1- Can you please tell me, which task to do 1st, so i can implement above fetures ?
Q-2 Also there are pages which has 2 List boxes. Means 2 Tables data need to be retrieved & displayed. So what is good method to display Multiple Tables data in the view, in current situation.
Note: This is small internet based site, but not having too much traffic. Also there is no Mobile-App reading this data.
So can you guys please help me...!!!
Any thoughts/article/video/link are welcome...!!!
Thanks
Devsql
|
|
|
|
|
I believe you are getting confused in MVC probably it's new for you so you are ending up rewriting a lot of code as you mentioned here. I will suggest to spend some time on MVC first so you will get a better idea and to code further. There is no special pattern for each of page you mention but you have to choose which is best suite you.
modified 20-Sep-20 21:01pm.
|
|
|
|
|
I thought I had this worked out in my main project, then I created a lite version of the project.
I can't figure out how to get my error handler page to work.
What works
Exception Pages when a page fails, I get the Exception message.
What doesn't work
when I have the URL up say Home, and I type in /Home/jllk;lk;lk;l junk, I expect to get the /Error/Page404 or /Error/Page500
What happens
I get a blank page with nothing.
What I have going
Web Config - This was suppose to handle page not found.
<customErrors mode="On">
<error statusCode="404" redirect="~/Error/Page404" />
<error statusCode="500" redirect="~/Error/Page500" />
</customErrors>
So this runs in Global.asax
void Application_Error(object sender, EventArgs e)
{
if (HttpContext.Current.IsDebuggingEnabled)
{
HttpException httpException = new HttpException();
RouteData routeData = new RouteData();
string controller = Request.RequestContext.RouteData.Values["controller"].ToString();
string action = Request.RequestContext.RouteData.Values["action"].ToString();
Response.Clear();
Server.ClearError();
if (controller != null)
routeData.Values.Add("controller", controller);
else
routeData.Values.Add("controller", "Error");
if (IsAjaxRequest())
{
Response.Write("Your JSON here");
}
else
{
if (httpException != null)
{
int httpCode = httpException.GetHttpCode();
switch (httpCode)
{
case 500:
Response.StatusCode = 404;
Response.ContentType = "text/html";
routeData.Values.Add("action", "Page500");
Server.ClearError();
break;
case 404:
Response.StatusCode = 404;
Response.ContentType = "text/html";
routeData.Values.Add("action", "Page404");
Server.ClearError();
break;
default:
Response.StatusCode = 404;
Response.ContentType = "text/html";
routeData.Values.Add("action", "Page404");
Server.ClearError();
break;
}
IController errorController = new coastEnviromental.Controllers.ErrorController();
try
{
Response.TrySkipIisCustomErrors = true;
errorController.Execute(new RequestContext(new HttpContextWrapper(Context), routeData));
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
Response.Redirect("Error");
}
}
}
}
}
Then the controller fires
public class ErrorController : Controller
{
public ActionResult Index()
{
return View();
return View("Page404", "Error");
}
public ActionResult Page404()
{
return View();
}
public ActionResult Page500()
{
return View();
}
}
And I get a blank page.
I tried setting a break point on the View, but It never hits.
If it ain't broke don't fix it
|
|
|
|
|
After Easter egg hunting for an hour, I added the string error to the ActionResult and now the View Renders
hmm.........
public class ErrorController : Controller
{
public ActionResult Index(string error)
{
return View();
}
public ActionResult Page404(string error)
{
return View("Page404");
}
public ActionResult Page500(string error)
{
return View("Page500");
}
}
If it ain't broke don't fix it
|
|
|
|
|
Hi Dear,
I'm Muhammad Bilal i want to develop Inventory module in Asp.NET. So please help me how i will start this module by using ASP.NET in MVC framework
|
|
|
|
|
So where do you stuck?
modified 20-Sep-20 21:01pm.
|
|
|
|
|
This is not a technical question as it sounds. What are you expecting from here?
|
|
|
|
|
Hi,
I have downloaded an Angular JS(or 2) Project to run and learn, its giving me error for both the ng serve and npm start, I am not understanding why Angular creators made my life so hell, no project from Internet I am able run so far and test so that I can learn, I want to learn but I can't do anything if whatever I try if it fails.
Here are the errors when I ran the npm start:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\aaleem01\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'start' ]
2 info using npm@4.4.4
3 info using node@v6.10.1
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle webapplication@0.0.0~prestart: webapplication@0.0.0
6 silly lifecycle webapplication@0.0.0~prestart: no script for prestart, continuing
7 info lifecycle webapplication@0.0.0~start: webapplication@0.0.0
8 verbose lifecycle webapplication@0.0.0~start: unsafe-perm in lifecycle true
9 verbose lifecycle webapplication@0.0.0~start: PATH: C:\Users\aaleem01\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin;C:\Users\aaleem01\Desktop\Angular2Apps\dotnetcoreapp\node_modules\.bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files (x86)\Microsoft SDKs\F#\4.0\Framework\v4.0\;C:\Program Files (x86)\MSBuild\14.0\bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools;C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\VCPackages;C:\Program Files (x86)\HTML Help Workshop;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Performance Tools;C:\Program Files (x86)\Windows Kits\10\bin\x86;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Enterprise Vault\EVClient\;C:\Program Files\ServiceNow;C:\Program Files (x86)\WebEx\Productivity Tools;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\WINDOWS\system32\config\systemprofile\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\nodejs\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files\Git\cmd;C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\GitExtensions\;C:\Program Files\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn\;C:\Program Files (x86)\Symantec\VIP Access Client\;C:\Program Files\dotnet\;C:\Program Files\ServiceNow;C:\Program Files\nodejs\;C:\Users\aaleem01\.dnx\bin;.bin;C:\Program Files (x86)\Microsoft VS Code\bin;C:\Users\aaleem01\AppData\Roaming\npm
10 verbose lifecycle webapplication@0.0.0~start: CWD: C:\Users\aaleem01\Desktop\Angular2Apps\dotnetcoreapp
11 silly lifecycle webapplication@0.0.0~start: Args: [ '/d /s /c',
11 silly lifecycle 'tsc && concurrently "npm run tsc:w" "npm run lite" ' ]
12 silly lifecycle webapplication@0.0.0~start: Returned: code: 2 signal: null
13 info lifecycle webapplication@0.0.0~start: Failed to exec start script
14 verbose stack Error: webapplication@0.0.0 start: `tsc && concurrently "npm run tsc:w" "npm run lite" `
14 verbose stack Exit status 2
14 verbose stack at EventEmitter.<anonymous> (C:\Users\aaleem01\AppData\Roaming\npm\node_modules\npm\lib\utils\lifecycle.js:279:16)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at EventEmitter.emit (events.js:191:7)
14 verbose stack at ChildProcess.<anonymous> (C:\Users\aaleem01\AppData\Roaming\npm\node_modules\npm\lib\utils\spawn.js:40:14)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at ChildProcess.emit (events.js:191:7)
14 verbose stack at maybeClose (internal/child_process.js:886:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid webapplication@0.0.0
16 verbose cwd C:\Users\aaleem01\Desktop\Angular2Apps\dotnetcoreapp
17 verbose Windows_NT 6.1.7601
18 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\aaleem01\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "start"
19 verbose node v6.10.1
20 verbose npm v4.4.4
21 error code ELIFECYCLE
22 error errno 2
23 error webapplication@0.0.0 start: `tsc && concurrently "npm run tsc:w" "npm run lite" `
23 error Exit status 2
24 error Failed at the webapplication@0.0.0 start script 'tsc && concurrently "npm run tsc:w" "npm run lite" '.
24 error Make sure you have the latest version of node.js and npm installed.
24 error If you do, this is most likely a problem with the webapplication package,
24 error not with npm itself.
24 error Tell the author that this fails on your system:
24 error tsc && concurrently "npm run tsc:w" "npm run lite"
24 error You can get information on how to open an issue for this project with:
24 error npm bugs webapplication
24 error Or if that isn't available, you can get their info via:
24 error npm owner ls webapplication
24 error There is likely additional logging output above.
25 verbose exit [ 2, true ]
When I said ng serve it simply tells me that "You have to be inside an Angular CLI project in order to use the serve command." I am inside a project that I created but I copied the code from online into it. I don't know what to do, if at least one example project if Angular 2 guys can give with a Microsoft Web API would have been good.
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
|
Hi Guys. Please provide me with basic steps of creating a C# data access layer and business logic layer.
|
|
|
|
|
Step 1. Search Google for articles.
Step 2 to n. study, design, code and test.
|
|
|
|
|
|
|
Hi
I would advise that you write the data access layer by using the repository pattern. It should return each object/record from the database as it is in the database. The business logic layer will use these repositories to perform crud operations.
The business layer should contain all the business rules for accessing/restricting data, validations etc.
This layer is best implemented with view models(DTO objects) created on it as you might know the data you store in a database might not necessarily the same as it comes from the UI. The presentation layer will use these DTO objects to pass data to the business layer. Hope this makes sense.
|
|
|
|
|
HI,
I want to ask a question regarding DropDownList.
This is the code:-
<asp:dropdownlist id="DropDownList1" runat="server"
="" onselectedindexchanged="DropDownList1_SelectedIndexChanged" height="22px" width="77px" autopostback="True">
<asp:listitem>+54 Argentina
<asp:listitem>+93 Afganistan
<asp:listitem selected="True">+91 India
<asp:listitem>+61 Austrila
<asp:listitem>+91 India
<asp:listitem>+32 Belgium
<asp:listitem>+91 India
<asp:listitem>+53 Brazil
<asp:listitem>+359 Bulgaria
<asp:listitem>+86 China
<asp:listitem>+299 GreenLand
<asp:listitem>+33 France
<asp:listitem>+49 Germany
<asp:listitem>+852 HongKong
<asp:listitem>+52 Mexico
So, I want if user select +33 France from DropDownList then in DropDownList it should display +33 FR instead of this full name +33 France which is mention in DropDownList???So,is it possible??? How can I achieve this???
|
|
|
|
|
You can see DisplayText set to your control here it is "+33 France" and what you have selected. However, you can have different Value returned for your selection you made.
If you want to see the different text before and after selection for the same control you can't.
modified 20-Sep-20 21:01pm.
|
|
|
|
|
What you are trying to do is not a good practice. Why do you want to change the dropdown list after user selected it. Are you making things harder while there might an easier solution for you actually need ???
|
|
|
|
|
hello
h have a problem in opening the html page of my website with / at the end of url
for example when i open the below page without / at the end of url,the page open corrctly but when i put the / at the end of url,the page didn't open
example url :
correct address : [open correctly]
incorrect url : [open incorrectly]
please help me
|
|
|
|
|
When clicked on above both URLS it opens correctly. What exact issue you are facing?
modified 20-Sep-20 21:01pm.
|
|
|
|
|
Hi,
I am after some guidance how to incorporate angularjs into this project. I am looking for a nicer way of writing the data to the table. Any help would be most appreciated.
public class RaceDayDisplayController : ApiControllerWithHub<RaceDayDisplayHub>
{
[HttpPost]
[Route("api/DoSomething")]
public HttpResponseMessage DoSomething(Rootobject model)
{
Hub.Clients.All.LastSectional(model.sectionTimes[0].runners);
}
}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Display</title>
</head>
<body>
<h2>Real-Time Raceday Data</h2>
<table id="showData"></table>
<!--
<!--
<script src="/Scripts/angular.js"></script>
<!--
<script src="/Scripts/jquery-1.10.2.min.js"></script>
<!--
<script src="/Scripts/jquery.signalR-2.1.2.js"></script>
<!--
<script src="/signalr/hubs"></script>
<script type="text/javascript">
$(function () {
var myHub = $.connection.raceDayDisplayHub;
try {
$.connection.hub.start();
myHub.on('LastSectional', function (runners) {
$("#showData tr").remove();
$('#showData').append('<tr><td width="150">Pos</td><td width="210">Name</td><td width="150">Margin</td><td width="150">Last Sectional</td><td width="150">Cumulative Times</td></tr>');
for (var i = 0; i < runners.length; i++) {
$('#showData').append('<tr><td>' + runners[i].position + '</td><td>' + runners[i].bookNumber + ' ' + runners[i].name + '</td><td>' + runners[i].margin + '</td><td>' + runners[i].sTime + '</td><td>' + runners[i].cumTime + '</td></tr>');
}
});
} catch (e) {
alert(e.message);
}
});
</script>
</body>
</html>
|
|
|
|
|
Hi All,
I have an ASP.Net Web Form Application and I have a button called "Open Cash Drawer" in the form, and I want when click the button call a windows form application on the client PC to open the cash drawer.
I do some search on the Internet and the result is to use "Register URI Scheme" to interact web and windows application together .
Please let me know how to do that, and give me any sample code if possible.
Thanks Alot
|
|
|
|
|
True, that is the only possible solution here.
Also, apart from that, you also need to make sure that your desktop application is also available on the client device, installed and listening for that URL or URI, or the protocol — you can check how Torrent clients, Skype client etc work. They use the same methods to listen to a button click, and then the browser itself starts the default application for that URL (uTorrent for the magnet links, Skype for call links, your email client for mailto links etc). This article covers everything you need to do in order to register that URI in the registry, Registering an Application to a URI Scheme (Windows).
Rest of the stuff is not at all complex, the only thing is to have the client install your desktop application, if they trust you, they will, if they do not then you need to earn some trust.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Could someone please explain what is happening in the following code?
Private Sub BindListView()
Dim constr As String = ConfigurationManager.ConnectionStrings("Tokens4UDissertationSite").ConnectionString
Using con As New SqlConnection(constr)
Using cmd As New SqlCommand()
cmd.CommandText = "SELECT ProductID, ProductName, ProductDescription, ProdImage, CustomerID, Cost FROM Product ORDER BY ProductID DESC"
cmd.Connection = con
Using sda As New SqlDataAdapter(cmd)
Dim dt As New DataTable()
sda.Fill(dt)
ListView2.DataSource = dt
ListView2.DataBind()
End Using
End Using
End Using
End Sub
|
|
|
|
|
That one is a simple code, that connects to a database and reads the records, to show them in a listview.
A few things to understand here include,
1) SqlConnection
2) DataTable
3) ListView
If you can understand this, and have a basic understanding of how a database works, then you would easily get to the point where you can know what this program is doing. Secondly, if you ever stumble upon such a problem, always try to Google for the objects provided here, such as, SqlConnection etc. Google would provide you with some useful information about them, through MSDN, or through any other popular channel.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|