|
I finally fixed it and it works great now.
It was a Windows 10 problem. Guess the last big update broke it.
So I had to create a installation disk and do sort of a clean install.
Now my VS2017 15.5.1 works and all the project templates are there now.
And the Views have intellisense and color now. Go Figure, spent 2 days thinking it was VS2017
If it ain't broke don't fix it
|
|
|
|
|
Hi
I've created my own rest service. For test purpose i've used Soap UI for testing of the service.
Now i try to consume this service in a webform. On the controller i can see that it has processed a call, so the service request gets through to my service. By debugging i can see that the rest server gets the data from the database.
When i try consuming the service in a asp.net 4.5 webform it hangs...
it just hangs on this statement
var response = await client.GetAsync("ServerConfig");
My request code looks like this:
private WebApiClientOptions options = new WebApiClientOptions("http://localhost:54990/api", "ServerConfig");
protected void Page_Load(object sender, EventArgs e)
{
List<ServerConfig> list = null;
list = this.Index().Result;
}
public async Task<List<ServerConfig>> Index()
{
List<ServerConfig> list = null;
using (WebApiClient<ServerConfig> client = new WebApiClient<ServerConfig>(options))
{
var liste = await client.GetManyAsync();
}
return list;
}
i hope there is a clever person WHO can help a complete newbiee
Yours
Wilco
|
|
|
|
|
You have a classic deadlock.
await signs the rest of the method up to run as a continuation when the awaited task completes. By default, it will be scheduled to run in the same execution context as the caller.
Calling .Result on a task blocks the current thread until the task has completed. But the task can't complete until the continuation has run on the current execution context. Which can't happen until the current thread is un-blocked. Which can't happen until the task has completed.
The quick-and-dirty fix is to add .ConfigureAwait(false) to your awaited tasks. That allows the continuation to run on a different thread:
var liste = await client.GetManyAsync().ConfigureAwait(false);
The best solution would be to move your work to a proper task-returning async method, and register that as an async task:
private void Page_Load(object sender, EventArgs e)
{
RegisterAsyncTask(new PageAsyncTask(LoadAsync));
}
private async Task LoadAsync()
{
List<ServerConfig> list = await Index();
...
}
Using Asynchronous Methods in ASP.NET 4.5[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks
I got the registerAsyncTask to Work
Yours
Wilco
|
|
|
|
|
I have a process that populates a pdf template based on user input. Can the system handle multiple users filling out web form and populate pdf template and save the populate pdf into a different directory.
I am using Itextsharp. We are using one pdf template to create the pdfs. Should I put the PDF template in the database and load it into my program as a blob?
Thanks,
mjc
|
|
|
|
|
Michael Clinton wrote: Can the system handle multiple users filling out web form and populate pdf template and save the populate pdf into a different directory. Almost certainly, although it's hard to tell without seeing your code.
I do something very similar using PDFSharp without any problems. So long as you're using FileShare.Read when you open the file, other threads and processes should be able to read it at the same time.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Greetings again experts,
I have seven gridview controls, Gridview1 through Gridview7.
For now, I am posting below the code for two of the seven gridview controls.
<asp:gridview ID="Gridview1" gridlines="None" runat="server" ShowFooter="true" AutoGenerateColumns="false" onrowdatabound="Gridview1_RowDataBound" OnRowDeleting="Gridview1_RowDeleting">
<Columns>
<asp:BoundField DataField="RowNumber" Visible="false" HeaderText="Row Number" />
<asp:TemplateField HeaderText="Name">
<headerstyle horizontalalign="Left" />
<ItemTemplate>
<asp:TextBox ID="txtsourcename" placeholder="Name..." runat="server" style="width:250px;" class="form-control"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Address">
<ItemStyle HorizontalAlign="Left"></ItemStyle>
<ItemTemplate>
<asp:TextBox ID="txtsourceaddress" placeholder="Address..." runat="server" style="width:250px;" class="form-control"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Income">
<ItemStyle HorizontalAlign="Left"></ItemStyle>
<ItemTemplate>
<asp:TextBox ID="txtsourceincome" placeholder="Income...(example: 1000)" runat="server" style="width:250px;" class="form-control txtsourceincome numeric"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="">
<ItemTemplate>
<asp:Button ID="ButtonAdd" runat="server" Text="Add"
onclick="ButtonAdd_Click" CssClass="grvAddButton" OnClientClick="return ValidateEmptyValue();" />
</ItemTemplate>
</asp:TemplateField>
<asp:CommandField ShowDeleteButton="True"><ControlStyle CssClass="grvDelButton" /></asp:CommandField>
</Columns>
</asp:gridview>
<span style="font-weight:bold;font-size:18px;color:#000000;">Name and address of income source of spouse greater than $1,000.00 (No comma (,) or period(.); Example 1000)</span><br /><br />
<asp:gridview ID="Gridview1" GridLines="None" runat="server" ShowFooter="true" AutoGenerateColumns="false" onrowdatabound="gGridview1_RowDataBound" OnRowDeleting="Gridview1_RowDeleting">
<Columns>
<asp:BoundField DataField="SpouseNumber" Visible="false" HeaderText="Row Number" />
<asp:TemplateField HeaderText="Name">
<headerstyle horizontalalign="Left" />
<ItemTemplate>
<asp:TextBox ID="txtspousename" placeholder="Name..." runat="server" style="width:250px;" class="form-control"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Address">
<ItemStyle HorizontalAlign="Left"></ItemStyle>
<ItemTemplate>
<asp:TextBox ID="txtspouseaddress" placeholder="Address..." runat="server" style="width:250px;" class="form-control"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Income">
<ItemStyle HorizontalAlign="Left"></ItemStyle>
<ItemTemplate>
<asp:TextBox ID="txtspouseincome" placeholder="Income...(example: 1000)" runat="server" style="width:250px;" class="form-control txtsourceincome numeric"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="">
<ItemTemplate>
<asp:Button ID="ButtonAdd2" runat="server" Text="Add"
onclick="ButtonAdd2_Click" CssClass="grvAddButton" OnClientClick="return ValidateSPEmptyValue();" />
</ItemTemplate>
</asp:TemplateField>
<asp:CommandField ShowDeleteButton="True"><ControlStyle CssClass="grvDelButton" /></asp:CommandField>
</Columns>
</asp:gridview>
Our requirement is that each gridview control must have a checkbox next to it.
Users are asked to fill all the textboxes in each gridview control.
However, if user does not see the need to complete the textboxes in any particular gridview control, then we need to have user check a box next to each gridview control to disable that gridview control.
If any gridview is not completed and a box is not checked, an error needs to be raised and user should not be allowed to submit the form.
Does anyone know to do this?
Thanks in advance
|
|
|
|
|
It should just be as simple as a checkbox with auto postback, that triggers code wired to an event handler for the checkbox
and then say Gridview1.Disable
I've never done it personally with a gridview, but the control should have the disable feature, or visible and just make it disappear.
If it ain't broke don't fix it
|
|
|
|
|
First of all, thanks a lot for your response.
If you have not done it with Gridview, especially when you have to make sure that user cannot submit without either completing the textboxes for a particular view or checking a box next to a particular gridview, then you can't it is simple.
|
|
|
|
|
All the .Net stock controls for WebForms follow the same format. I've done it in code behind using server controls in pure code, but have never done it in code behind using the control on a web form. But it should be the same thing.
If it ain't broke don't fix it
|
|
|
|
|
I have done it too.
It is much different with Gridview, Repeater, etc.
That's why I am struggling with it.
|
|
|
|
|
I have successfully implemented code which uses ManagementObjectSearcher to query and return the status of printers on one of our servers.
Now what I would like to do is use this code from an ASP.net web page so that my user community can view the status of those same printers. The problem is that the account that the webserver executes as does not have the appropriate permissions to retrieve the data.
My research seems to point to a method to get the data where I would pass credentials while executing the query.
The building blocks are:
1) Dim Credentials As New CimCredential(PasswordAuthenticationMechanism.Default, domain, username, securepassword)
2) Session = CimSession.Create(computer, SessionOptions)
3) session.QueryInstances("@root\cimv2", "WQL", "SELECT * FROM Win32_Printer")
However, I can't seem to find the proper reference to the Microsoft.Management.Infrastructure.dll
My development environment is VS2015 / Win10 and I plan to deploy the web application to a 7.5 IIS server.
Can someone help me find the correct dll location ?
Am I approaching this problem correctly ?
Thanks.
|
|
|
|
|
According to this thread[^], it should be in:
C:\Program Files (x86)\Reference Assemblies\Microsoft\WMI\v1.0
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Yea, I saw that reference too. Unfortunately, that path does not exist on my Win10 machine.
Am I missing a feature?
|
|
|
|
|
It looks like it's part of one of the Windows SDKs - either 8 or 10 should do.
Windows 10 SDK - Windows app development[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
i have developed a web site with asp.net webform. i hosted the site my pc local iis. when i browser the site the url appear in my browser address bar looks like http://localhost:8800/gb/default.aspx
now my default.aspx page has many hyperlinks and those links look likes
http://localhost:53741/
http://localhost:53741/About.aspx
http://localhost:53741/Contact.aspx
now i want to attach country code taken from browser address bar url with all the links in default.aspx page. so after attaching the new url will be looking like
http://localhost:53741/gb
http://localhost:53741/gb/About.aspx
http://localhost:53741/gb/Contact.aspx
so i test a outbound rule to attach country code with all the links in my default.aspx page.
my outbound rule look like....a screen shot attached.
screen shot 1
enter image description here[^]
screen shot 2
enter image description here[^]
screen shot 3
enter image description here[^]
after implementing my outbound rule when i am browsing my site then getting error due to outbound rule. i am weak in iis rewrite rule. may some where i made mistake but could not figure out my mistake. so please some one help me to fix this issue.
again i am telling what i am trying to do. when i am browsing my site then my address bar url look like http://localhost:8800/gb/default.aspx in this url there is a country code that is gb.
the country code i need to take from there with outbound rule and attach that country code with all the hyperlinks in default.aspx page. so my all hyperlinks in default.aspx page will be looking like below example.
http://localhost:53741/gb
http://localhost:53741/gb/About.aspx
http://localhost:53741/gb/Contact.aspx
this iis rewrite rule i tried
<outboundRules>
<rule name="add outbound rule" preCondition="Ishtml" enabled="true" stopProcessing="true">
<match filterByTags="A" pattern="([a-z]{2}/(.*))" negate="true" />
<action type="Rewrite" value="gb/{R:2}" />
</rule>
<preConditions>
<preCondition name="Ishtml">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="text/html" />
</preCondition>
</preConditions>
</outboundRules>
after applying the above rule i am getting error and error as follows
Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: The content in the application file is not valid.
if still my objective not clear to anyone then please ask me. if anyone understand what i am trying to do then please help me to achieve my goal. thanks
|
|
|
|
|
|
just come to know from this site https://www.microsoft.com/en-us/learning/mcsd-web-apps-certification.aspx that MCSD Web Applications exam has 3 papers.
those are as follows
1) Programming in HTML5 with JavaScript and CSS3 480
2) Developing ASP.NET MVC Web Applications 486
3) Developing Microsoft Azure and Web Services 487
before giving the exam i need load of sample questions for the above 3 exams.
i need a web site which allow me to give test exam with sample question paper for 3 exams.
so please share some good resource by which i can prepare myself to pass mcsd exam.
i found this web site url but the website asking for money http://www.mindhub.com/microsoft-certification-practice-tests-and-study-guides-s/64.htm#/?_=1&filter.custom_field3=Practice%20labs&page=1
my financial condition is not good so i am looking free resource only to prepare myself for the above 3 exams.
looking for help. thanks
|
|
|
|
|
Microsoft provide study guides and links for all their certifications. Go back to the MSDN page and search from there.
|
|
|
|
|
Just learn the topics to an adequate level and you'll pass the test.
|
|
|
|
|
What i want, if the text is too long to fit as per the defined width, the text should be wrapped in next row. I don’t want to expand the column width to accommodate this text in one row. In other words, I want to wrap the text in next row if the text inside this columns exceeded the width of the column defined in gridview and reportviewer
|
|
|
|
|
|
Hi All,
I just tried put DataTable in my project. It look cool and robust. For quick result. I put this instruction into html file and it worked like charm. This is the screenshot.
Confidence with that html result, then, I created a new project in .Net Core and put those code into About/Contact template. What I remove html code to cshtml are head and body tag. But I got plain table like this screenshot.
What I tried to do debugged the javascript by using F12 Developer Tools and I found "Object doesn't support property or method 'DataTable.'"
Why this could happen in VS 2017 CE .net core 2 ? Meanwhile, it works well in html file.
I emphasize the link (css and js) just works fine in html.
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css">
<script src="https://code.jquery.com/jquery-1.12.4.min.js" type="text/javascript"></script>
<script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js" type="text/javascript" ></script>
<script>
$(document).ready(function() {
$('#example').DataTable();
} );
</script>
I also tried by using VS 2015 CE .net Core 1.1, it gave me the same result.
How to overcome this ? Please, advice....
Rgds,
modified 19-Nov-17 20:32pm.
|
|
|
|
|
You need to check the rendered output of the page that isn't working, to see what's gone wrong with the links.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I made a mistake by putting jQuery twice, in the top layout (_Layout) and the last layout.
|
|
|
|