Posts Tagged by asp.net
StaticFileModule on IIS 7.5 on windows server 2008 intercepts unexpected requests
September 17, 2014 | Posted by forumadmin under TechQns |
Comments off
|
I have a little problem here. We are developing ASP.NET MVC 3 application. This is my production server system.webServer section: <validation validateIntegratedModeConfiguration=”false” /> <rewrite><rules><rule name=”http to https” stopProcessing=”true”><match url=”(.*)” /><conditions><add input=”{HTTPS}” pattern=”off” /></conditions><action type=”Redirect” url=”https://{HTTP_HOST}/{R:1}” redirectType=”Found” /></rule></rules></rewrite> <urlCompression dynamicCompressionBeforeCache=”false” doStaticCompression=”false” doDynamicCompression=”false” /> <caching enabled=”true” enableKernelCache=”true” maxCacheSize=”0″ maxResponseSize=”262144″> <profiles> <add extension=”.png” policy=”CacheUntilChange” varyByHeaders=”” varyByQueryString=”” kernelCachePolicy=”CacheUntilChange” /> […]
Bearer token (OAuth2) encryption process and code in Asp.net Identity?
September 16, 2014 | Posted by forumadmin under TechQns |
Comments off
|
I want to know, what is the process to encrypt and decrypt a Bearer token used in OAuth2 and the code in Asp.Net Identity. Once the server receives a token, it is able to retrieve the UserId, Roles, Claims and all properties inside it. So, how are Bearer tokens decrypted. What is encryption algorithm and […]
Multiple Checkboxes in ASP Form
September 15, 2014 | Posted by forumadmin under TechQns |
Comments off
|
First, lets keep in mind that I am a professional designer and self-taught developer. So excuse the lack of knowledge on the developing part. I have created a form using .ascx and the code behind .ascx.cs. I have been using this form successfully for awhile with basic text fields, validations and receive an email with […]
google gdata webmaster api c# website validation
September 13, 2014 | Posted by forumadmin under TechQns |
Comments off
|
I’ve been using the google Gdata toolkit in C#, and have figured out how to add new sites to webmaster tools. I already have html validation files on the sites I’m adding, but I can’t figure out how to get the site to validate via the api- I’ve found a few versions of sample code […]
Passing data from one asp.net application to another?
September 13, 2014 | Posted by forumadmin under TechQns |
Comments off
|
I have 2 asp.net applications. They both use the same data, but they use a different database schema and use the data in a different way. What would be the best way for to pass the data from one application to another. SSIS – Should I use ETL to take the data from one application […]
How to perform searching in autofill on textbox with single enter press
September 13, 2014 | Posted by forumadmin under TechQns |
Comments off
|
<div style=”position: absolute; top: 841px; left: 12%;”> <asp:TextBox ID=”txtHotel” runat=”server” CssClass=”search_hot_txtbox” ></asp:TextBox> </div> <br> <script type=”text/javascript”> $(function fnc() { $(“.search_hot_txtbox”).autocomplete({ source: function(request, response) { $.ajax({ url: “hotel-result.aspx/BindDatatoDropdown”, data: “{ ‘cn': ‘” + request.term + “‘ }”, dataType: “json”, type: “POST”, contentType: “application/json; charset=utf-8″, dataFilter: function(data) { return data; }, success: function(data) { response($.map(data.d, function(item) { […]
Storing a picture returns a solid block of color instead of a picture
September 13, 2014 | Posted by forumadmin under TechQns |
Comments off
|
I am trying to understand why this code stores a solid black image instead of the picture I’m trying to upload (i.e. the image is never stored, just a black box with the same measurements as the picture I’m uploading)? Protected Sub btn_FileUpload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn_FileUpload.Click If FileUpload1.HasFile Then […]
How to change the Css class for a button when the button is clicked
September 13, 2014 | Posted by forumadmin under TechQns |
Comments off
|
i have a css class for a button in my .aspx page,i want to change cssclass for the button when it is clicked i used the below code `.btnmbl1 { font-weight: bold; font-size: 15px; color: Black; font-family: Calibri; width: 100px; height: 70px; border-style: none; background-image: url(../images/Button_Mobile_R2.gif); } .btnmbl1:focus, .btnmbl1:hover { background-image: url(../images/Button_Mobile_R2_1.gif); }` Plz help […]
how to use css of html control into asp control?
September 13, 2014 | Posted by forumadmin under TechQns |
Comments off
|
Like I have a button in xHTML using css3. I am using the template into asp dotnet project. So i want to use the css of the button( example control ) into buttons am using in the asp dot net. Please tell me a way to do that. Asked By – Kamal Thakur […]
Binding values to user control but it returns me null
September 13, 2014 | Posted by forumadmin under TechQns |
Comments off
|
in my webfrom, I have a repeater which is getting some item information from a webservice, and the output is list. <asp:Repeater ID=”Repeater1″ runat=”server”> <ItemTemplate> <uc1:ItemDetailsUserControl runat=”server” ID=”ItemDetailsUserControl1″ HotelCode=’Eval(“Item.Code”)’ CityCode='<%#Eval(“City.Code”)%>’/> </ItemTemplate> To get the details for each item, I am having this definition in my usercontrol – ItemDetailsUserControl, public string ItemCode { set; get; } […]
Returning a view based on a if condition
September 13, 2014 | Posted by forumadmin under TechQns |
Comments off
|
I am trying to return a view based on a simple if condition but not able to do so. It seems like i am missing a very simple stuff in somewhere but couldnt figured it out. What i am trying to do is return different views based on user ids. If the below code is […]
How to fire cash drawer closing event using CashDrawer Class (POS for .NET v1.12)
September 13, 2014 | Posted by forumadmin under TechQns |
Comments off
|
I am developing an POS application, I am able to open the cash drawer. but I am not able to find the event when cash drawer is closed. Please provide me code sample/ event which fire when cash drawer get closed. Asked By – user3913152 Read Answers 0
Javascript does not work in asp.net content page
September 13, 2014 | Posted by forumadmin under TechQns |
Comments off
|
I am trying to display the javascript date time picker in a textbox on the content page, that is derived from the master page, but the datetime picker is not getting displayed. This is my content page: <link rel=”styleheet” href=”Datepicker.css”> <script src=”https://code.jquery.com/jquery.js”></script> <script src=”Datepicker.js”></script> <script> $(document).ready(function() { $(‘#dp’).datepicker(); }); </script> <script> $(document).ready(function() { $(‘#dp1′).datepicker(); }); […]
How to use Two QueryStringParameter in SelectCommand
September 13, 2014 | Posted by forumadmin under TechQns |
Comments off
|
I want to know how to pass two QueryStringParameter from two different pages to SelectCommand. <asp:SqlDataSource ID=”SqlDataSource1″ runat=”server” ConnectionString=”<%$ ConnectionStrings:con %>” SelectCommand=”SELECT * FROM [admin_video] where c_id=@c_id OR c_name=@c_name” > <SelectParameters> <asp:QueryStringParameter Name=”c_id” QueryStringField=”id1″ DbType=”Int32″/> <asp:QueryStringParameter Name=”c_name” QueryStringField=”id2″ /> </SelectParameters> </asp:SqlDataSource> Page:1 <a href=”page1.aspx?id1=<%# Eval(“c_name”) %>” Page:1 <a href=”page2.aspx?id2=<%# Eval(“c_id”) %>”Everything is fine but when […]
Get drop down list default selected item is not passing to the controller in Asp.net MVC
September 13, 2014 | Posted by forumadmin under TechQns |
Comments off
|
I have a problem when the user (Edit the event) it display drop down list for time, and text box for date. But when the user submit the form the, edit action is not receiving the old value for time. This code works fine if the user changes the time value, it will get the […]
Why Image control with farsi character in ImageUrl not showed?
September 13, 2014 | Posted by forumadmin under TechQns |
Comments off
|
I have an image control. image file name is in farsi language. But image not show in run time. I use IIS5 in Windows XP. of course if image file name changed to english it showed. <asp:Image ID=”Image1″ runat=”server” ImageUrl=”~/img/تقویم.jpg” Width=”200px” /> Asked By – Samiey Mehdi Read Answers 0
How to apply css to asp.net LinkButton?
September 13, 2014 | Posted by forumadmin under TechQns |
Comments off
|
I want to create a css block, which will apply css class to all <asp:LinkButton> throughout my web site. I can apply css for <asp:TextBox> throughout the website using below code single block. input[type="text"] {width:150px;} Above code make width=150px to all asp textbox in my web site The same way I want to write a […]
c# Compiler Says A Method Is Not There
September 13, 2014 | Posted by forumadmin under TechQns |
Comments off
|
I developed code in a single non-compiled .aspx page that ran great, but when I copy-pasted the code into a code-behind page the c# compiler is raising an error: error CS1061: ‘System.Collections.Generic.IEnumerable’ does not contain a definition for ‘Descendants’ and no extension method ‘Descendants’ accepting a first argument of type ‘System.Collections.Generic.IEnumerable’ could be found (are […]
Advanced search not working on changing city in drop down in MVC 4
September 13, 2014 | Posted by forumadmin under TechQns |
Comments off
|
@using (Html.BeginForm(“Search”, “Home”, FormMethod.Post)) { <figure class=”span3 pull-left left_background”> <div class=”span4 pull-left”> <div class=”left_container pull-left”> <div class=”tab”> @Html.RadioButton(“Type”, “Sale”, new { onchange = “this.form.submit();” }) Buy @Html.RadioButton(“Type”, “Rent”, new { onchange = “this.form.submit();” }) Rent </div> <span class=”search_headings”>City:</span><br> @Html.DropDownList(“City”, null, “Select City”, new { @class = “span11″, Id = “CityS” }) @Html.DropDownList(“Locality”, null, “Select Locality”, […]
How to update tree view control values into database in asp.net?
September 13, 2014 | Posted by forumadmin under TechQns |
Comments off
|
I have a table on database something like below where the subcategories populate into treeview with column SubcatID like When i update my values with check the nodes and its updated perfectly and i am use the code as below foreach (TreeNode node in tvCategories.Nodes) { // get the child nodes TreeNodeCollection childNodes = node.ChildNodes; […]
No overload for method InsertQuery takes 15 arguments
September 13, 2014 | Posted by forumadmin under TechQns |
Comments off
|
I want to insert dummy values into data base. But it will generate an error. The code is Given below. protected void Button5_Click(object sender, EventArgs e) { int i; for (i = 1; i <= 100; i++) { DataSet3TableAdapters.tbl_energy_reportTableAdapter state = new DataSet3TableAdapters.tbl_energy_reportTableAdapter(); int j; j = state.InsertQuery(i.ToString(), i.ToString(), i.ToString(), i.ToString(), i.ToString(), DateTime.Now.AddDays(i), i.ToString(), i.ToString(), […]
Cant retrieve EmployeeId from Active Directory
September 13, 2014 | Posted by forumadmin under TechQns |
Comments off
|
My GetActiveDirectory() method is used to get data from Active Directory using the SamAccountName, and it’s working but the problem is the user.EmployeeId return no sign of data. Why I can’t receive the EmployeeId and how can I fix it? This is my codes: public void GetActiveDirectory(DataTable DataStorage, string SamAccountName) { var domainContext = new […]
CSS Bundles with Controller Route Source
September 13, 2014 | Posted by forumadmin under TechQns |
Comments off
|
I created a controller path to return a css file, which works, and returns Response.ContentType = “text/css”. Now I’m trying to put that URL in my bundles file, like this: bundles.Add(new StyleBundle(“~/Content/custom”).Include( “~/CSS/Custom/1″ )); NOTE: /CSS/Custom/1 is a route that returns a text/css file. In my view I have: @Styles.Render(“~/Content/custom”) When I build the project, […]
Stored procedure stopped when Browser closed
September 13, 2014 | Posted by forumadmin under TechQns |
Comments off
|
A long running process (SQL stored procedure) is started by calling ExecuteSqlCommandAsync. The stored procedure returns data as long as I have the browser up and running. When the browser is closed, the stored procedure stop or rollbacks. Is this the expected behavior? If I have to run a long running process, what should I […]
How to avoid writing messy JavaScript in an ASP.NET code-behind?
September 12, 2014 | Posted by forumadmin under TechQns |
Comments off
|
I’m questionning about what is the best practice to use Javascript with ASP.NET. I don’t know if it’s the best practice but I add the javascript client side event inside the codebehind. It is working correctly but is this the best practice? For example, I got a radio button control and I add the Javascript […]
SQL mistaking value for column name during updating
September 12, 2014 | Posted by forumadmin under TechQns |
Comments off
|
Can someone, please, tell me why would these pieces of code show SQL error Invalid column name Poe I am either blind or retarded, but I cannot see any single thing that is wrong in this code (except for variable names maybe) Updating code: in index.cshtml if(IsPost) { var it = Request.Form["it"]; db.Execute(“UPDATE students SET […]
Save file directly to disk in ASP.NET without loading it into memory
September 12, 2014 | Posted by forumadmin under TechQns |
Comments off
|
I have an ASP.NET web application and I want my users to be able to upload large files. However, some files are very large and uses too much memory. In principle it should be possible to receive the request stream and write it directly to a FileWriter stream, removing any need to load the entire […]
ASP.NET MVC – VirtualPathProvider not working with local IIS
September 11, 2014 | Posted by forumadmin under TechQns |
Comments off
|
I am trying to build a MVC website with some of the views being served from database. I have started implementing all the logic using VirtualFiles and VirtualPathProviders and everything works fine on IISExpress… problem appears when I switch to local IIS. Virtual File is being found but then nothing happens, I get 404 error. […]
Removing .aspx from URL with an IIS Version 6 server
September 11, 2014 | Posted by forumadmin under TechQns |
Comments off
|
I have a asp.net application that is running on a server that has IIS 6 on it. I want to set-up a redirect so that instead of my page reading www.google.com/About-Us.aspx it just has www.google.com/About-Us. I’ve seen in IIS7 where you can just write a rewrite into your web config file, but I’m not having […]
Adjust memory quotas for a process
September 11, 2014 | Posted by forumadmin under TechQns |
Comments off
|
Adjust memory quotas for a process is the IIS APPPOOL\Classic .NET AppPool or IIS APPPOOL\DefaultAppPool is required / need to take permission? Asked By – user1249359 Read Answers 0
Linq query somehow causes a SEGFAULT in an IIS thread from MVC application
September 11, 2014 | Posted by forumadmin under TechQns |
Comments off
|
Okay. This is one of the strangest errors I’ve come across as a developer. I an ajax call on the client side that calls a MVC Update method: [HttpPost] [Permissions(Role.Admin)] public bool Update(Model m) { try { if (_repository.Where(x => x.Email == m.Email).Any()) /*more logic*/ return true; } catch (Exception ex) { return false; } […]
How to made an Angular JS + .Net (asmx) webservice http.post login page
September 11, 2014 | Posted by forumadmin under TechQns |
Comments off
|
How are ya? We got a project here, that must to be easy but is driving us crazy! I have a login page, with two fields: username and password, we also have a webservice with a function called: FazerLogin(). That function made all the login job, validation, return and redirect to homepage. My problem is: […]
Binding data in gridview using inner join
September 11, 2014 | Posted by forumadmin under TechQns |
Comments off
|
I am using a mysql database and I am trying to populate the gridview with the inner join query but I can’t work it out. Here is my code. Sub loadingaccess4() Dim adapter As New OdbcDataAdapter(“Select customer.CustomerName, customer.CustomerID from customer INNER JOIN transaction on customer.CustomerID=transaction.CustomerID”, dbconn) Dim dataset As New DataSet dataset.Clear() adapter.Fill(dataset, “”) Me.GridView4.DataSource […]
URL forwarding within a web config file for Windows Server 2012 IIS 8.5
September 11, 2014 | Posted by forumadmin under TechQns |
Comments off
|
I am trying to forward a specific URL on my website to another website and I can’t figure out how to set the proper values in the web.config file for my IIS server. For example I would like to forward www.example.com/ballot to ballot.example.com So far I’ve tried the following but it doesn’t have any affect […]
How to use LINQ in DataTable?
September 11, 2014 | Posted by forumadmin under TechQns |
Comments off
|
I’m trying to use LINQ in DataTable and I use Ntier for my solution, But when I’m try to use LINQ in DataTable it gives me an error: Sorry for my english Error 1 Cannot convert lambda expression to type ‘string’ because it is not a delegate type c:\users\ba-ojt\documents\visual studio 2010\Projects\GoActiveDirectory\PresentationTier\Default.aspx.cs 21 25 PresentationTier How […]
How to configure IIS for sending compressed JSON
September 11, 2014 | Posted by forumadmin under TechQns |
Comments off
|
I have a ASP.Net 2.0 website hosted in IIS6. It has webmethod defined in code-behind classes. These webmethods are accessed by jQuery Ajax. Now, when I host the website in a gzip enabled website, we are getting content-length as zero in the client. Without compression the website works fine. I read in the article Enabling […]
ASP.NET TextBox TextMode set to Date not working in IE 11
September 10, 2014 | Posted by forumadmin under TechQns |
Comments off
|
<asp:TextBox ID=”txtDate” runat=”server” TextMode=”Date” /> It works in Chrome, but not in Firefox or IE 11. Googling around isn’t yielding a lot of helpful answers. As far as I know, IE 11 is HTML5 compliant. Asked By – user79284 Read Answers 0
maxAllowedContentLength & maxRequestLength Set For Maximum, Security Loophole?
September 9, 2014 | Posted by forumadmin under TechQns |
Comments off
|
I have a webapp (MVC 4) that it purpose is to do manipulation of files, the way it works is : User upload file – > the site does manipulation on the file -> the user download the file again (the new version of the file). So I need to accept a large files size […]
Edit multiple instances of models asp.net mvc
September 9, 2014 | Posted by forumadmin under TechQns |
Comments off
|
I want to edit multiple (say 4) instance of my model Restriction: public int RestrictionID { get; set; } public string portefeuille { get; set; } I try to do this in my view: @model IEnumerable<Management.Models.Restriction> @for ( int i= 0; i < 4; i++) { @Html.EditorFor(_ => Model.[i].portefeuille) } But I have an error […]
Suddenly need to specify secure locations in web.config (resources, …) or redirects to login
September 9, 2014 | Posted by forumadmin under TechQns |
Comments off
|
I updated my application to MVC 5 and at first, none of my original assets (js, css, img, ..) load. This is when i specified the location element in web.config <location path=”Images”> <system.web> <authorization> <allow users=”*” /> </authorization> </system.web> The authentication works fine, but at first, it always brought me back to the login page, […]
I need ideas on how to set a default printer on web page
September 8, 2014 | Posted by forumadmin under TechQns |
Comments off
|
I have Visual Studio 2010 and use vb.net in the Code behind. My Shipping Dept needs to print to a specific ZEBRA LABEL printer when on a certain web page. From what I’ve read, this is not possible via javascript or .net? I read somewhere that maybe I could create an ActiveX control and then […]
ASP.NET MVC5 Route Annotation MS_DirectRouteMatches
September 8, 2014 | Posted by forumadmin under TechQns |
Comments off
|
I have a small problem with ASP.NET and MVC5 (I am beginning with MVC.NET). Until yesterday, everything worked great! But today, I don’t know why, I have problems with “Custom routes Annotations”. I have a Controler “Prodouits” with this Action : [Route("{culture}/Produits/{nom_groupe}/{nom}-{id}")] public ActionResult Detail(string nom_groupe, string nom, string id) { // … return View(); […]
asp.net memory and available memory
September 7, 2014 | Posted by forumadmin under TechQns |
Comments off
|
I am new to this so this is probably a simple question. I have a website and in my control panel I see 3 figures Total Memory (151 GB) Available memory (15 GB) Working set(memory) (17 MB) what exactly do those figure mean? and I noticed that as website visitors increase the available memory goes […]
Cleaning up ViewBags in GET and POST
September 5, 2014 | Posted by forumadmin under TechQns |
Comments off
|
I have been using viewbags to populate the dropdown lists on my view using razor and I was wondering if there is anyway to cleanup this code. I have been doing this for a while and I hate the way it looks and it makes all the code look extremely cluttered and have to duplicate […]
Sending data to individual clients instead of using Clients.All in SignalR
September 5, 2014 | Posted by forumadmin under TechQns |
Comments off
|
Abstract Hi, I’m working on an application which uses SignalR to send data updates to client. Data access is controlled via permissions, each data record (Item) contains a reference to one permission. Users are associated with roles, each role is associated with a set of permissions. Any given user is allowed to see only records […]
GridView RowUpdating
September 5, 2014 | Posted by forumadmin under TechQns |
Comments off
|
I have a gridview that displays the category, at the foot of the gridview I have a text box and a button that when you click on the first checks if the name of the category there if returned if cancel the insertion and alerts in a label, this all works fine, the problem is […]
visual studion debug web server looking in wrong path for web.config
September 5, 2014 | Posted by forumadmin under TechQns |
Comments off
|
I recently changed a drive letter from F: to D:. As it happens it contains my “My Documents folder. Now when I try to run a web app in the debugger in visual studio, I get (in the browser): HTTP Error 500.19 – Internal Server Error The requested page cannot be accessed because the related […]
CAS Policies for GAC Deployment issue
September 5, 2014 | Posted by forumadmin under TechQns |
Comments off
|
I have a .Net web application(3.5 Framework) which i converted it to WSP package and deployed the front-end aspx pages to _Layout of SharePoint webapplication and the third party Dll’s(Like System.Oracle.Client) to the GAC folder of SharePoint Server. The deployment went well and i dint see any issues. But when i try to open my […]