Subscribe: Personal Site Starter Kit
http://forums.asp.net/rss.aspx?ForumID=1003&PostID=1128547
Preview: Personal Site Starter Kit

All Forums



All Forums



Last Build Date: Mon, 19 Feb 2018 09:09:18 -0800

 



ASP.NET Web API message UWP application

2018-02-18T14:52:19.237-08:00

This is jut a general question.

What's the best way to message a UWP application from a Web API  / Webservice application.?

I need a webservice application to send messages to UWP applications, UWP applications do not need to send responses.  I can't use Azure.

Thanks 




Posting to MVC Controller on Another Site

2018-02-19T15:24:20.22-08:00

Hello everyone and thanks for your help in advance.  I am learning MVC and want to design a form that resides on a public site, lets call it https://www.mysite.com.  When the user submits the form, I would like to have it post to a site on another server (that I control) called https://www.mysite.net.  Currently, mysite.net uses Asp.Net 4.5 Identity to authenticate.  mysite.com also uses Asp.net 4.5.  I have been reading posts on this topic and it appears that CORS might be a possibility, but I am confused in that CORS seems to be mostly used for Ajax calls and am not sure if it is appropriate for use with form posts or how to implement this.  Any help would be appreciated.




Loop MVC list out using jscript

2018-02-19T16:41:43.52-08:00

I have created 17 modules in HomeController.cs as below namespace CristalStandards.Controllers { public class HomeController : Controller { private List mod; public HomeController() { mod = new List() { new Modules() { ModuleImage = "/Images/ModuleIcons/Brand.png", HeaderImage = "/Images/Headers/Modules/Brand.png", ModuleTitle = "BrandCheck", ModuleDescription = "provides the tools and support necessary to create, develop, maintain or protect the business brand standards.", ButtonText = "Download BrandCheck PDF", ModuleColour = "#f68834", MFunction = "BRAND()", PDF = "/PDF/Cristal_BrandCheck_Datasheet.pdf" }, new Modules() { ModuleImage = "/Images/ModuleIcons/Standards.png", HeaderImage = "2", ModuleTitle = "StandardsCheck", ModuleDescription = "2", ButtonText = "2", ModuleColour = "2", MFunction = "STANDARDS()" }, new Modules() { ModuleImage = "/Images/ModuleIcons/Room.png", HeaderImage = "3", ModuleTitle = "RoomCheck", ModuleDescription = "3", ButtonText = "3", ModuleColour = "3", MFunction = "ROOM()" }, new Modules() { ModuleImage = "/Images/ModuleIcons/Food.png", HeaderImage = "4", ModuleTitle = "FoodCheck", ModuleDescription = "4", ButtonText = "4", ModuleColour = "4", MFunction = "FOOD()" }, new Modules() { ModuleImage = "/Images/ModuleIcons/Security.png", HeaderImage = "5", ModuleTitle = "SecurityCheck", ModuleDescription = "5", ButtonText = "5", ModuleColour = "5", MFunction = "SECURITY()" }, new Modules() { ModuleImage = "/Images/ModuleIcons/Lab.png", HeaderImage = "6", ModuleTitle = "LabCheck", ModuleDescription = "6", ButtonText = "6", ModuleColour = "6", MFunction = "LAB()" }, new Modules() { ModuleImage = "/Images/ModuleIcons/Aqua.png", HeaderImage = "7", ModuleTitle = "AquaCheck", ModuleDescription = "7", ButtonText = "7", ModuleColour = "7", MFunction = "AQUA()" }, new Modules() { ModuleImage = "/Images/ModuleIcons/Pool.png", HeaderImage = "8", ModuleTitle = "PoolCheck", ModuleDescription = "8", ButtonText = "8", ModuleColour = "8", MFunction = "POOL()" }, new Modules() { ModuleImage = "/Images/ModuleIcons/Spa.png", HeaderImage = "9", ModuleTitle = "SpaCheck", ModuleDescription = "9", ButtonText = "9", ModuleColour = "9", MFunction = "SPA()" }, new Modules() { ModuleImage = "/Images/ModuleIcons/Fire.png", HeaderImage = "10", ModuleTitle = "FireCheck", ModuleDescription = "10", ButtonText = "10", ModuleColour = "10", MFunction = "FIRE()" }, new Modules() { ModuleImage = "/Images/ModuleIcons/Safety.png", HeaderImage = "11", ModuleTitle = "SafetyCheck", ModuleDescription = "11", ButtonText = "11", ModuleColour = "11", MFunction = "SAFETY()" }, new Modules() { ModuleImage = "/Images/ModuleIcons/Crisis.png", HeaderImage = "12", ModuleTitle = "CrisisCheck", ModuleDescription = "12", ButtonText = "12", ModuleColour = "12", MFunction = "CRISIS()" }, [...]



After importing Excel file into datatable, all number character will not import and left as Null

2018-02-19T16:37:46.87-08:00

I learn import a Excel file into a datatable from this link.

http://vb.net-informations.com/excel-2007/vb.net_excel_oledb.htm

Second column of Excel file is text type and data stored like "EMP" or "119".

After imported, all number character will not import and left as Null.

How to fix it?




how to make login session last for 1 year using membership provider?

2018-02-19T10:09:38.043-08:00

Hi,

I have a login form codes are below

 protected void btn_login_Click(object sender, EventArgs e)
    {

        if (Membership.ValidateUser(TextBox_user_name.Text.ToString(), TextBox_password.Text.ToString()))
        {
            FormsAuthentication.RedirectFromLoginPage(TextBox_user_name.Text.ToString(), false);
            Session.Timeout = 60;
            Response.Redirect("users/Details.aspx");
        }
        else
        {
            lb1.Text = "username or password is incorrect";
        }
    }

and Webconfig :

	

		
		
		
	

Problem is that my login session last for 20 mints i guess or so after hour it again ask me for login so how to have session that last for like 1 month or year?

Please help in this thanks.




JavaScript runtime error: '$' is undefined

2018-02-19T16:32:46.767-08:00

Hello friends,

I implemented a please wait functionality in one of my web forms. It is working fine right now. I noticed that when I put async in my script that gets data from google api I get the error message "0x800a1391 - JavaScript runtime error: '$' is undefined" but when I remove Async it works fine.

    
    





.
.
.



Loading... please wait ...



(image)



and the css styles are:

.modal {
    position: fixed;
    top: 0;
    left: 0;
    background-color: black;
    z-index: 99;
    opacity: 0.8;
    filter: alpha(opacity=80);
    -moz-opacity: 0.8;
    min-height: 100%;
    width: 100%;
}

.loading {
    font-family: Arial;
    font-size: 10pt;
    border: 5px solid #67CFF5;
    width: 200px;
    height: 240px;
    display: none;
    position: fixed;
    background-color: White;
    z-index: 999;
}

How do I fix thais, I really need to use async because I need to improve performance here and there and wherever I can.




Asp.net core - website hosting on iis: page was not found (error 404) when directing to any route

2018-02-07T05:08:15.413-08:00

I have a problem with my asp.net core 2.0 website, i want to host my website on IIS 10 locally, so i published my project to a folder, and enable IIS service then copy my website folder to inetpub/wwwroot, my login page - start page was ran ok when i ran it directly, but i routing to any other route, i got "Page was not found HTTP ERROR - 404", so just my login page is runnable,  any suggestion and solution? please help me, it took me about 2 days, but i do'nt have any solution for this




i want camera in my asp.net page so that a qr code can be scanned and the data can ve retrieved

2018-02-19T16:30:13.87-08:00

asp.net c# web form

web cam using to scan a qrcode




Split a string separated by comma but avoiding the ones within parentheses

2018-02-16T15:58:03.163-08:00

Scenario: Need to be split a string separated by comma but avoid the ones within parentheses while splitting. 

Please suggest how can i achieve the below output. Any help will be highly appreciable.

Example:

Input: asas, jkjlk, (asl, we), lk, adsd, (sd, mn)

Result

=====

asas

jkjlk

(asl, we)

lk

adsd

(sd, mn)




HttpCookie.HttpOnly Property using MVC, how to set as False

2018-02-19T16:20:22.417-08:00

Hello,

When we run a security scan on our site we get an error of "Session Cookie Does Not Contain the "Secure" Attribute" ( This could allow a man-in-the-middle attack)
Screen Shot: https://www.screencast.com/t/1cEiBQ1Zelb

Here is how it looks when using a cookie tool.. https://www.screencast.com/t/KXZxfflN 

It shows the cookie as only allowing over http but we need it over httpS

In my searching I find statements of how its to be set in code... such as on MSDN https://msdn.microsoft.com/en-us/library/system.web.httpcookie.httponly(v=vs.110).aspx ...
But my developer tells me "That link won't work. It is only applicable to webforms. We are using mvc"

So how to fix this this when using MVC?

Thanks
Shane Weddle




how can open modal automatically when there is a message in tempdata

2018-02-19T15:14:58.67-08:00

Hi, 

how can I open modal automatically when there is a message in tempdata

@if (TempData["message"] != null)
    {

        


    }




[Problem] Web-app on browser "The resource you are looking for has been removed, had its name changed, or is temporarily unavailable"

2018-02-19T15:58:50.31-08:00

Good morning, I have developed a web-app in .aspx format (through Visual Studio 2017). I have included all the .aspx files in a folder inside my Aruba server, to display them via a browser. When I search for a .aspx file, which is part of the web-app folder, on the browser (zzz.mysite.it/webappfolder/filename.aspx) I find the following words: "The resource you are looking for has been removed, had its name changed, or is temporarily unavailable ". Why?


As for the aforementioned wording, I would like to point out that within the Windows 2012 R2 server I uploaded the ASPX 2.0 and 4.5 framework and the IIS server. ASP.NET is up and running. In addition, a subsite called "webappaccess" has been created inside the server, containing all the .aspx files. But the error, and therefore the wording, remains the same.

Thank you




What Is Meant By Incompatible Interface

2018-01-25T16:19:32.567-08:00

I was reading up on Adapter Design Pattern and the following is what it states:

Adapter Design Pattern "converts the interface of a class into another interface clients expect. Adapter 
lets classes work together that couldn't otherwise because of incompatible interfaces".

I understand the concept for the most part but I'm still unclear on some things. In this context what is meant by interface and how do I recognize when an object has an interface that is incompatible with another object? Could someone please explain what is meant by Interface in this context with some example code, thanks.




JQGrid dataUrl not hitting Webmethod

2018-02-19T15:37:30.987-08:00

Hi       I am using the Free JQGrid in which one of the columns (PRODUCT_NAME) is a dropdownlist which is to be populated from my table product_mast in sql server 2008. I have used edittype:'select'  and in editoptions  dataUrl: "frmGRN.aspx/LoadRM." But the response i get is the full HTML of frmGRN.aspx insted of json Data from LoadRM Webmethod which i would convert in the buildselect function to html select. My HTML is