Subscribe: Custom Server Controls
Preview: Custom Server Controls

All Forums

All Forums

Last Build Date: Tue, 06 Dec 2016 10:04:35 -0800


Show popup and close it after 5 seg



I'm new at Jquery and I found the following  post

with the code:

Here is my webpage

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="mensagem.aspx.vb" Inherits="mensagem" %>



But it doesn't work

Any help, please?

asp roles not working



I'm using vs2010 I'm having an issue, I have created an event for the login clicked on the login.  I'm trying to use if (user.isinrole("Sales")) Response.Redirect to a specific folder with a default page that I've created.  Although even trying to redirect to the about page doesn't work either.  If I type the page address in manually to the URL it works, however if I deny another role member in the web.config file it doesn't seem to deny them either.  What could I be doing wrong?



JSON webservice


I need to public a webservice that accept JSON POST to get records and write in sql table.

Normally I use SOAP and I don't know JSON but I've tried.

So I've build a webservice .ASMX file in ASP.NET and published a function with one parameter (string) in wich you can put JSON formatted string.

Then I deserialize string and write my record.

If I try using local browser it work.

But when I try to use JSON QUERY (application to call JSON webservice) not work.

What's wrong?

This is my code in webservice:

    Public Function PutTrackInfo(ByVal strDataInfo As String) As Boolean

            Dim Posizione As Posizione = DirectCast(JsonConvert.DeserializeObject(strDataInfo, (GetType(Posizione))), Posizione)

            If Not Posizione Is Nothing Then

                Return True
            End If

        Catch ex As Exception
            Dim NuovoLog As New Log

            NuovoLog.Description = ex.Message
            NuovoLog.Data = Today
            Return False
        End Try

How I can publish my webservice to allow JSON post? 

Attendance Tracker Help using SQL


I need help making an attendance tracking system where an someone can log in and input and track attendance.

I am using sql server for the tables. Right now, I have two tables done, one for classes and one for students.

My main trouble is making a clickable gridview, where I click can on classes. Once I click on a classes in gridview, all the students pop up for that class, once the students pop up, I can click on a specific student and change his/her attendance. I've been trying a gridview, but don't know how to connect both tables together, to use on gridview.

SQL Helper Connection String


I am in the process of moving a bunch of old sites to a new server that no longer have source or project files available.  I spent days figuring out sqlconnection issues and fixing rewrites.

"Almost" everything is now working.  I had to hardcode in a new connection string to each file:

Dim MGSQLConnectionString As String = ConfigurationManager.ConnectionStrings("MGSQLConnectionString").ToString()

That works most everywhere, however, in some places of the code SQL Helper is being utilized to check data. Is there a way that I can "set" the connection string for SQLHelper too?  Code like below errors out because it can't connect to the database.  I have to do this for a lot of sites, so if there's a way to just set in one place for each site, it would be great.  Any advice would be greatly appreciated!!

Using sqlHelper As New SQLHelper
Dim dr As SqlClient.SqlDataReader
dr = sqlHelper.GetDataReader("SELECT * FROM Admin WHERE AdminID = " & adminID)
Do While dr.Read
txtName.Text = FixDBNulls(dr("Name"))
txtEmail.Text = FixDBNulls(dr("Email"))
cmdSubmit.Text = "Update"
dr = Nothing
End Using

How to deploy Angular2 application built using AspNetCore in IIS


I am facing some issues in deploying the Angular2 application built using AspNetCore in IIS.

I tried publishing the application using 'Publish' wizard in Visual Studio IDE. Copied the entire published contents and placed in the physical path mapped to a Virtual directory in IIS.

when I try to browse the Index.html page I am getting the following error "HTTP Error 404.0 - Not Found" as specified in the snapshot. Please find the virtual folder path structure in the snapshot.

Any ideas what is the mistake I am doing here and what is the correct way to deploy aspnetcore application in IIS?(image) (image)

My Startup.cs file is as below

public class Startup
        public Startup(IHostingEnvironment env)
            // Set up configuration sources.
            var builder = new ConfigurationBuilder()
                .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
                .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true);

            Configuration = builder.Build();

        public IConfigurationRoot Configuration { get; set; }

        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
            // Add framework services.


        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)

            if (env.IsDevelopment())

            app.Run(ctx =>
                return Task.FromResult(0);

After upgrading to 1.1, can't get project to run - Fix my project.json


I've spent WAY too much time trying to get this to work, so I'm throwing this out to the forums.  It's been two weeks without my website working and I'm fed up. This is a ASP.NET Core Web Application (.NET Framework). I was excited to see the new release, I downloaded it from the main page. It's weird that it said that it's 1.1, but the link says  Download .NET Core 1.0.1 tools Preview 2 I went to NuGet Package Manager and it updated my references to 1.1 - But now I get many errors.   The one I'm stuck on is an old version of Logging.Abstractions, but searching everything including project.lock.json doesn't reveal any reference to it.  Could not load file or assembly 'Microsoft.Extensions.Logging.Abstractions, Version= I've also tried to make a new project and copy the project.json over, but that's not helping either.  Can someone show me where I went wrong?   Thanks! "dependencies": { "BundlerMinifier.Core": "2.2.306", "LinqKit.Microsoft.EntityFrameworkCore": "1.1.9", "Microsoft.AspNetCore.Authentication.Cookies": "1.1.0", "Microsoft.AspNetCore.Diagnostics": "1.1.0", "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.1.0", "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.1.0", "Microsoft.AspNetCore.Mvc": "1.1.0", "Microsoft.AspNetCore.Razor.Tools": { "version": "1.0.0-preview2-final", "type": "build" }, "Microsoft.AspNetCore.Routing": "1.1.0", "Microsoft.AspNetCore.Server.IISIntegration": "1.1.0", "Microsoft.AspNetCore.Server.Kestrel": "1.1.0", "Microsoft.AspNetCore.Session": "1.1.0", "Microsoft.AspNetCore.StaticFiles": "1.1.0", "Microsoft.EntityFrameworkCore.SqlServer": "1.1.0", "Microsoft.EntityFrameworkCore.SqlServer.Design": "1.1.0", "Microsoft.EntityFrameworkCore.Tools": { "version": "1.0.0-preview2-final", "type": "build" }, "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0", "Microsoft.Extensions.Configuration.Json": "1.1.0", "Microsoft.Extensions.Configuration.UserSecrets": "1.1.0", "Microsoft.Extensions.Logging": "1.1.0", "Microsoft.Extensions.Logging.Abstractions": "1.1.0", "Microsoft.Extensions.Logging.Console": "1.1.0", "Microsoft.Extensions.Logging.Debug": "1.1.0", "Microsoft.Extensions.Options.ConfigurationExtensions": "1.1.0", "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.1.0", "Microsoft.VisualStudio.Web.CodeGeneration.Tools": { "version": "1.0.0-preview2-final", "type": "build" }, "Microsoft.VisualStudio.Web.CodeGenerators.Mvc": { "version": "1.0.0-preview2-final", "type": "build" }, "Sendgrid": "8.0.5", "Twilio": "4.7.2" }, "tools": { "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final", "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final", "Microsoft.[...]

Loading the XML into MVC model


hi, I need to load the country and the corresponding state values from the xml tag CES into the MVC model . Basically the xml contains the country and state values.I need to show the country and state in two dropdown in mvc 4.0. On selecting the country on one dropdown , corresponding state values has to be shown in the another dropdown. Please help me  code snippet to load the data from the xml to the model. below is the xml and the code for model. XML Master page control and content page


 I was assigned a task to add a checkbox to control a series of webpages. I created a copy of my current masterpage and for these 6 pages I'm going to use this version. I added the checkbox to the masterpage. When I load my first page it runs

-masterpage - Page_Load

-control(ascx) Page_Load

After the page loads I check the checkbox and it runs

-masterpage - Page_Load

-control(ascx) Page_Load

-masterpage - chkBox_CheckedChanged

I have to know that it was checked in the page_load of the control(ascx) page. How can I get this info before or during the controls page_load? The ascx file is registered and added to an aspx page call test.aspx.

Thank you 

Problem with Microsoft.Office.Interop.Word


I have a c# web app that replaces placeholder texts with desired values in a word document. everything is working as it should be. I need to convert the word document after changes are done to PDF and send to browser so client can download.

problem is when the word document converts to pdf, the fonts that I used will convert to a default font courier new.

An important point that I need to point out is that when I change Identity to Interactive User in Component Service fonts are fine.

may be there is a permission issue to access fonts?

note: my OS is Win Server 2012, IIS App Pool Identity: Local service, also I've added full control permissions for Everyone and IIS in security tab


Using Repository Class And Business Logic Layer


Hi all, I am not not sure how I would use the Repository pattern in MVC. It was clear when I was using web form but now I'm not sure if I should put everything inside of the Model.

I was thinking that perhaps I should  create a class library project for the Business Logic layer and put a Repository class in it. The Repository class will inherit from the DbContext class and the Repository class will contain code for CRUD operations. Then Entity framework will be installed in the Model and referenced by the Business Logic Layer.

Please point out if there is anything wrong with how I think a Repository should be used, thanks.

How to create select or insert Sqlserver in


i want to build my application  inteaction with sql, i can insert delete or select ... that lile phpmyadmin.

in webforms how to do this, thanks in advance

Web Page has expired


Hi Folks,

I am facing issue of Page as 'Web page expired' when I am trying to get back to previous page, Its working in Google Chrome but not working in Mozilla and IE.

Below is the line where I am clicking


Please help on this..



angularjs2 to post data to mvc controller



I am trying to post data from angularjs2 to mvc controller.

The actual issue is that when I am trying with it then

See how am I trying ?

this is the typescript ---

  save(company: Company): Observable {     
        let headers = new Headers({ 'Content-Type': 'application/json' });, /*JSON.stringify(*/company/*)*/, { headers: headers }) 
             (data) => {                 
                new Observable()
             (err) => { console.log(err); new Observable(); },
            () => console.log('Complete')

         return new Observable();


this is the call to this service function

 onSignUpClicked(message: string): void {
           res => console.log(res),
            error => this.errorMessage = error

When I am debugging it (typescript) then it shows

  1. ConfirmPassword:"123"
  2. Name:"dfgfgf"
  3. Password:"123"
  4. UserName:""

Now see when it takes the control in the server side (MVC controller action) then it doesn't fill that data in the c# class.

see the snip below!AitLVJhHEke3gewZXrXatheLUUytcw

Kindly guide me.

Question on acepting long coma delimited csv string in body of post method


Could someone help:  I have an  Angular 2 app with the following issue.  I would like to add functionality where the user can click a button and send a csv file as an attachtment via email.  From what I have found, this is not an easy task with Angular 2 or JavaScript. 

Thus my question:

Would it make sense for me to have an Web API POST method that accepts a long comma delimited string in the body (I would assume I need to set the Content-type: application/text to do that).  And then I could create the file and send the email in C#.  The bad part of this design is that First my Web API would be calling the db and sending a Json result, then the client would be sending the data back to the API as a coma delimited string to be converted to a file and emailed. 

Note: I thought about just sending the get parameter  and making the db call again, but these queries take long enough as it is and the delay could be an issue.

Any thoughts or advice would be greatly appreciated.

Thank You.

Is there a way to wire up the create button on and MVC create form to run a javascript function that is currently attached to a submit button that runs the function from a partial view?


Hi All, thanks for viewing this question....

How would someone wire up a mvc create view button to run a function that was created and stored in a javascript file that is currently attached to partial view?

Currently there exist  have a partial view with the following code:

The function that it run is called GetRoute()

This was found on

on W3schools they do show some examples but it is not clear how one would format it to work with the create form..

Will every button that is clicked fire off this code??? It's just not clear.

The mvc create view create button looks like this:

Things that have been tried have been: 

But this does not run the function, also their does not seem to be a onclick option... only ondblclick... which makes no sense.

By is everything so backward in ASP.MVC??  All that is needed is when the user clicks the create record button on the mvc View 

create view it run the bloody function.

The Goal is to not require the user to have to click the second button if possible... but maybe it is not possible?

This was found while researching for the solution if their is any: But the user did not give any indication on how to use

a listener.  

So if below is the solution could someone explain how to make this work. As you can see the original poster 

just said try this without any guidance as this is very generic. 

$(document).ready(function () {

myButton.onclick = function (event) {
// in here you can call an ajax method or just navigate to an action
return false;

// or using jQuery
$('#myButton').click(function (e) {
// do whatever here

Thanks in advance!

Help me please - The name 'ViewBag' does not exist in the current context


Hi guys,

I can not show a page because of ViewBag.

I need it to pass the data to View.

Error List: My code: The name 'ViewBag' does not exist in the current context.

I have a Visual Studio 2015.


    Layout = null;





ViewBag.NotFound = "test string text";

I've tried everything on the internet. And nothing work.

Several attempts:

1 - I created a new mvc project, the same problem continues.

2 - devenv /ResetUserData

3- %LocalAppData%\Microsoft\VisualStudio\14.0\ComponentModelCache

4 - remove folder ".vs" and restar Visual studio.

Any ideas ?

Store view of a blog


In my data base blog how can i store the views (how much vies did it make)

Could not create type ASMX


I have an existing ASMX service which runs correctly. Recently i want to move it from the current project to a stand alone project.

The current structure is a Website which contains AsmxServices (Folder). Within this folder is the Customer folder containing the services.

Within the old site, in the App Code folder, there is a nested folder which contains the VB file the service calls.

I created a new Web Application project, referenced some of the dlls required and fixed all errors. I run the service and receive "Parser Error Message: Could not create type 'AsmxService/Customer/Service1'"

My Web Application project structure is

AsmxServices - Project name
  AsmxService - Folder
    Customer - Sub Folder

In the asmx file i have the below declaration

<%@ WebService Language="VB" CodeBehind="~/AsmxServices/AsmxService/Customer/Service1.vb" Class="AsmxService/Customer/Service1" %>

but continue to get the error "Parser Error Message: Could not create type 'AsmxService/Customer/Service1'".

Ive changed this line




but nothing seems to work. Anyway of narrowing down where the problem could be, or how to set the path?

xxx.aspx has not been pre-compiled, and cannot be requested


After adding Crystal Report and publishing project to server windows 2008, I got an error:

xxx.aspx has not been pre-compiled, and cannot be requested.

The project in my pc is working well (windows 7 and vs2010)

How to fix it?