Subscribe: Custom Server Controls
http://forums.asp.net/rss.aspx?ForumID=19
Added By: Feedage Forager Feedage Grade B rated
Language: English
Tags:
auth  btn  button  canvas  code  data  error  form  function  line line  line  microsoft  script  server  system  web 
Rate this Feed
Rate this feedRate this feedRate this feedRate this feedRate this feed
Rate this feed 1 starRate this feed 2 starRate this feed 3 starRate this feed 4 starRate this feed 5 star

Comments (0)

Feed Details and Statistics Feed Statistics
Preview: Custom Server Controls

All Forums



All Forums



Last Build Date: Tue, 17 Jan 2017 09:54:46 -0800

 



Maintain values using check box list during post back

2017-01-17T15:08:39.613-08:00

What's the best method for maintaining values using check box list during post back?




Server Error in Application.

2017-01-17T16:28:28.96-08:00

Hello,

I get an error on my website when I enter an url. I took a screenshot of the error:

http://www.bilddump.se/bilder/20170117174252-195.252.32.111.png

I wonder what is causing this error and what could be done to solve this issue!

The error tells to put this line in the web.config file:

I have done that but still I can't see any details of the error. This is how it looks now:




Thank you!




Community web sites

2016-11-22T04:09:31.793-08:00

Hi Companion
I checked the following link under
https://www.asp.net/community/websites
the following link is not working
http://www.dotnetvideos.net/

I learnt many things from it

(image) my question is whether the name of the website is renamed or is it dead
thanking you all
Anil Srivastava
Pune - India




Exception Handling

2017-01-17T07:48:19.927-08:00

Hi folks,

Here is my sample Code:

myApp.service('Service', function ($q, Service, $rootScope) {
	this.DB = function (fileName) {
		.................
		Service.getCache().then(function (db) {
			............
			var success = function(text){
				............
				............
				try{
					saveAS(text,fileName)
				} catch(e){
					$rootScope.disableAngularStateNavigation = false;
					console.log;
				}
			}
		}
	}
}

I want an exception handling using angularjs without try catch block.
Any Idea?
I am waiting for your response.
Thanks




Send Email to selected checked users

2017-01-11T09:37:17.723-08:00

Hi, 

I created a column for checkbox and i would like to send email to users which has been checked. How do I go about doing that? Do i need a IF ELSE Statement? How do display the email column to string? thanks a lot!

Controller:

        public ActionResult SendReminder(int id)
        {


            using (DatabaseEntities dbc = new DatabaseEntities())
            {
                DbSet dbs = dbc.users;
                IQueryable q = from p in dbs
                                            where p.Booking.event_id == id
                                            select p;
                List model = q.ToList();
                ViewBag.ButtonText = "Send Reminder Email";

                return View("ViewDetails", model);
                
            }
            
        }

Code for ViewDetails:

@using SendEmail.Models
@model List

@{
    Layout = "~/Views/Shared/_Layout.cshtml";
}

@ViewBag.ButtonText

@if (ViewBag.ButtonText == "Send Reminder Email") { @foreach (user u in Model) { }
First Name Last Name Email Select All
@u.first_name @u.last_name @u.email
}

http://s1174.photobucket.com/user/jmetjm/media/SSreminderemail_zps61rxom9w.png.html?filters[user]=146037794&filters[recent]=1&sort=1&o=0

The link is a picture of the code. When you click send reminder email, it will direct to the view display details of the users.




HTML Editor for VB.net

2017-01-03T18:29:51.827-08:00

Hello,

Can anyone recommend a free HTML Editor control?  I am having a hard time finding one.   I know I am asking the world, but one that is not that hard to configure.  Help as always is appreciated.


Thank you,

Bob




Multiple IF Conditions

2017-01-17T16:32:13.72-08:00

I'm having a difficult time understanding why this piece of code isn't working. I've group each clause as I thought they should be and nothing happens. My alert statement shows the checkbox value INDEED returns "false", yet nothing happens when I click my button. If the dropdown value is blank OR checkbox is false I want to show a message. 

var ddlValue = $("#ddlPostingMonth").val();
var ChkBooker = $('#Booker').prop("checked");
alert("This is the value: " + ChkBooker);
if ((ddlValue == "")  || (ChkBooker == "false")) 
{
  //Open dilaog to display message. 
}
else{}




Javascript compiler error

2017-01-11T23:58:25.453-08:00

Hi, 

I am working with Visual Studio 2015 update 3, and ASP.NET Core MVC v1.1.0

Whenever I have a compiler error blocking the build, I get a long list of Javascript errors in the Error List as well. It looks like one error per line of JS code.

As soon as I have found the actual C# error in that long list and have corrected it, all the javascript errors disappear.

Could this be a configuration issue, or is it a bug? 

Thanks Pieter




How to run the script on the page load instead of button clicked

2017-01-17T13:17:12.837-08:00

Overview:

I have two buttons on the page (Preview, Download), the basic functionality of the preview button is to capture the div elements and convert to the image, while the download button is used to save the image on the specified location.

Problem/Goal:

I want to execute the jquery script on the page load instead of firing the both buttons so that when the page load the div content automatically saved to the specified location (e:\images),

Current Code:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" %>











Codepedia.info

Html to canvas, and canvas to proper image



Codepedia.info is a programming blog. Tutorials focused on Programming ASP.Net,
C#, jQuery, AngularJs, Gridview, MVC, Ajax, Javascript, XML, MS SQL-Server, NodeJs,
Web Design, Software



html2canvas script allows you to take "screenshots" of webpages or parts
of it, directly on the users browser. The screenshot is based on the DOM and as
such may not be 100% accurate to the real representation.




Download


Preview :







Any ideas how to do that?




Record not getting added . It is showing Null values in Object

2017-01-17T16:39:48.877-08:00

Hi   I have below code but record is not getting added.  Index View @model IEnumerable @{ Layout = "~/Views/Shared/_Layout.cshtml"; } Index

@Html.Partial("_Bookcategory", Model) Partial View
ID S[...]



Combining Nodejs with ASP.NET for a scalable architecutre.

2017-01-15T14:12:42.52-08:00

Hello, i am a student, i am working in another domain then programming, i would like to hear your thoughts about this.

I need to build a highly scalable website, actually i need it to be as cheap as possible since my cash reserves are rather limited.

Apart from various caching strategies and so forth, here is one strategy i want to implement.

I will have 2 separate sites.

One will be a NodeJs powered website, that will serve static content (scripts, css, angular 2, have webpack running on it).I want to have it NodeJS because i want to learn a bit about Node in the process, and it is really hard to work with Angular 2/typescript enviromnent in visual studio for me.( some will disagree and thats fine ).

The other will be a ASP.NET WEB API 2 powered website, which will only expose some endpoints for the nodejs application to consume data.

Both will be hosted in Microsoft Azure's Web Apps.

Is this a good idea? are there any drawbacks, what do you guys think?

I understand Node runs on a single thread as javascript does.If i have a 2 cpu machine on Azure, will Node run on those 2 cpus as different instances, or will it just use one thread and the other cpu will stand by idly.




Bootstrap radio button group - inconsistent results

2017-01-17T13:25:59.41-08:00

Check out my jsfiddle here

There are a few problems:

I don't know how to make my sample code work in jsfiddle so that it pulls in bootstrap and I also don't know how to change from a regular post request to something that illustrates my problem

My problem is that this bootstrap radio button group works only when a button is clicked once. On post it correctly passes on TRUE or FALSE.

However, when the user clicks On or Off twice, or clicks one and then the other Request["year"] is empty.

Please advise how this can be fixed in the confines of my form submit.

@{

    Layout = "~/_SiteLayout.cshtml";
    
    if (IsPost)
    {
        var yearselected = Request["year"];
        var test = 0;
    }
}


Radio Group






Google auth giving error in azure web app

2017-01-17T16:00:33.02-08:00

Hi,

I have created a web app for uploading video in YouTube using YouTube API v3. I can upload video from my  localhost. Now I have hosted my mvc site in azure and it's working  fine but when I upload video on YouTube then it  gives error access is denied.

I have tries FileDataStore and giving a path. I have tries using blob storage but getting same error, If I create a access token locally and upload it to server then it doesn't give any error until token doesn't expires( 1 hour)

As per my understanding azure is preventing to create auth token in web app. in local auth token is created in app_data folder.

Please help me it is urgent and I am trying from pass 10 days. If you need code or have any question let me know.

error is

Access is denied

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Net.HttpListenerException: Access is denied

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 


[HttpListenerException (0x5): Access is denied]
   System.Net.HttpListener.SetupV2Config() +333
   System.Net.HttpListener.Start() +297
   Google.Apis.Auth.OAuth2.d__6.MoveNext() +188
   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
   Google.Apis.Auth.OAuth2.d__8.MoveNext() +530
   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
   Google.Apis.Auth.OAuth2.d__4.MoveNext() +376
   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
   Google.Apis.Auth.OAuth2.d__1.MoveNext() +263




Display data of table in grid view

2017-01-16T08:58:30.79-08:00

I m trying to display data of 2 tables in gridview 1st table is department table tbdep and 2nd is employe table tbemployee display as following Dept. Employee detail Dno: empno name. Address Dname: Here is error when i remove error line then there is another error occurs that is field or property with he name empno was not found on the selected data source Here is error description also tell me wher should i put this error code so t will becom error free Server Error in '/' Application. Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS0103: The name 'GetData' does not exist in the current context Source Error: Line 12: Line 13:
Line 14: Line 15: Line 16: Source File: c:\Users\simar\Documents\Visual Studio 2015\WebSites\WebSite21\Default.aspx Line: 14 Show Detailed Compiler Output: Microsoft (R) Visual C# Compiler version 4.6.1590.0 for C# 5 Copyright (C) Microsoft Corporation. All rights reserved. This compiler is provided as part of the Microsoft (R) .NET Framework, but only supports language versions up to C# 5, which is no longer the latest version. For compilers that support newer versions of the C# programming language, see http://go.microsoft.com/fwlink/?LinkID=533240 c:\Users\simar\Documents\Visual Studio 2015\WebSites\WebSite21\Default.aspx(14,72): error CS0103: The name 'GetData' does not exist in the current context Show Complete Compilation Source: Line 1: #pragma checksum "C:\Users\simar\Documents\Visual Studio 2015\WebSites\WebSite21\Default.aspx" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "442464BD2A7BD2979E6AC4D75D1BB9A306665626" Line 2: //------------------------------------------------------------------------------ Line 3: // Line 4: // This code was generated by a tool. Line 5: // Runtime Version:4.0.30319.42000 Line 6: // Line 7: // Changes to this file may cause incorrect behavior and will be lost if Line 8: // the code is regenerated. Line 9: // Line 10: //------------------------------------------------------------------------------ Line 11: Line 12: Line 13: Line 14: public partial class _Default : System.Web.SessionState.IRequiresSessionState { Line 15: Line 16: Line 17: #line 14 "C:\Users\simar\Documents\Visual Studio 2015\WebSites\WebSite21\Default.aspx" Line 18: protected global::System.Web.UI.WebControls.GridView GridView1; Line 19: Line 20: #line default Line 21: #line hidden Line 22: Line 23: Line 24: #line 10 "C:\Users\simar\Documents\Visual Studio 2015\WebSites\WebSite21\Default.aspx" Line 25: protected global::System.Web.UI.HtmlControls.HtmlForm form1; Line 26: Line 27: #line default Line 28: #line hidden Line 29: Line 30: protected System.Web.Profile.DefaultProfile Profile { Line 31: get { Line 32: return ((System.Web.Profile.DefaultProfile)(this.Context.Profile)); Line 33: } Line 34: } Line 35: Html file <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits=&qu[...]



save div content as jpg image

2017-01-17T15:54:01.113-08:00

i want to save the div elements on the page load. Currently its working when user click on the button. here is the current program:

ASPX Page


OnClick="btnExport_Click" OnClientClick="return ConvertToImage(this)" />


C# page

protected void ExportToImage(object sender, EventArgs e)
{
string base64 = Request.Form[hfImageData.UniqueID].Split(',')[1];
byte[] bytes = Convert.FromBase64String(base64);
Response.Clear();
Response.ContentType = "image/png";
Response.AddHeader("Content-Disposition", "attachment; filename=HTML.png");
Response.Buffer = true;
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.BinaryWrite(bytes);
Response.End();
}

I want to call the ExportToImage function on the page load, but its throwing an error "object reference not found" for the below line

string base64 = Request.Form[hfImageData.UniqueID].Split(',')[1];

Any ideas how to solve this?




Regarding cookie based auth and token based auth

2017-01-17T13:45:02.223-08:00

we know that form auth used cookie based auth. anyone can tell me when we should go for token based auth instead of cookie based auth ?

which one is good and secured a) cookie based auth b) token based auth

please explain with best example and scenario.




How to run the jquery script on the page load

2017-01-17T15:47:37.083-08:00

need to call the jquery script on the page load event instead of button clicks, how I can do that?

Current Program:



Download




send "bulk" emails & not get blacklisted?

2017-01-17T15:25:17.217-08:00

I have a page that brings up a gridview listing email addresses of some of my site members, and on that same page a form I can fill out with the Subject and Message I want to send to those site members.

On clicking the send button I have VB code-behind that steps through the gridview rows and sends the message to each email address.  The other day I did this with a hundred or so email addresses which resulted in my mail server getting blacklisted by some website.  This I discovered the next day when emails sent to @yahoo.com started being rejected.

So my question: How to get around this problem?  Would it help if I put some kind of delay between each send?  And if so, what code could be used that would not bog down the mail server?  Or some better solution?




Best Way for Editable Grid View

2017-01-17T13:27:08.693-08:00

Hello,

I'm very new for MVC

can some body please suggest me which is the best way to implement grid view.

i found webgrid, kendo,teleric,  angular js ng-grid, ng-table, ng-smart-table, datatable and many jquery girds. but still i got confused.

my requirement is

1)edit with popup

2)Search, paging, sorting

3)custom css and html template

I may have 1000 off rows (it will be better if some server side paging)

Appreciate for best response

Thank you




Data Annotations being ignored in .Net Core/EF Core Model (MySQL Backend)

2017-01-16T07:56:08.22-08:00

I have created a Web API using .Net Core 1.1 and EF Core. The backend is a MySQL Database, so I have included the *"MySql.Data.EntityFrameworkCore": "7.0.6-IR31"* dependency in the project.json file. I have a simple model in my project. I am trying to map the columns in my model to the columns in an existing database. So I am using Data Annotations. I have this:     using System;     using System.ComponentModel.DataAnnotations;     using System.ComponentModel.DataAnnotations.Schema;             namespace PropWorxAPI.Models         {             [Table("files")]             public partial class File             {                 [Key]                 [Column("file_id")]                 public int FileId { get; set; }                 [Required]                 [Column("file_num")]                 [MaxLength(50)]                 public string FileNum { get; set; }                 [MaxLength(255)]                 public string Description { get; set; }             }         } I want property **FileId** to map to field **file_id** in the database. However, when I run the project, it complains that there is no field **FileId** in the database. It's almost as if my column mapping annotations are being completely ignored. Any ideas? Thanks... Just in case, I am including my project.json file below:   {       "dependencies": {         "MySql.Data.EntityFrameworkCore": "7.0.6-IR31",         "Microsoft.AspNetCore.Mvc": "1.1.0",         "Microsoft.AspNetCore.Routing": "1.1.0",         "Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",         "Microsoft.AspNetCore.Server.Kestrel": "1.1.0",         "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0",         "Microsoft.Extensions.Configuration.FileExtensions": "1.1.0",         "Microsoft.Extensions.Configuration.Json": "1.1.0",         "Microsoft.Extensions.Logging": "1.1.0",         "Microsoft.Exten[...]