.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Using AuthenticationService from pure html Question?

Posted By:      Posted Date: August 30, 2010    Points: 0   Category :ASP.Net
After searching the web I'm completely confused as to what my options are for using the AuthenticationService from a pure html page (with JavaScript, so NO asp.net webform and NO ScriptManager. I didn't found any clear code snippets for my problem. What I found where some 'pieces' of the puzzle.Option 1using an Authentication.svc file (see hereunder), adapting web.config and using javascript to use the Sys.Services.AuthenticationService methods. However by just using the Sys.Services.AuthenticationService.login method as-is (with the 8 parameters) the system gives a 500 error.Authentication.svc<%@ ServiceHost Language="C#"    Service="System.Web.ApplicationServices.AuthenticationService"    Factory="System.Web.ApplicationServices.ApplicationServicesHostFactory" %>Option 2Setting  Sys.Services.AuthenticationService.set_path("Authentication_JSON_AppService.axd"); and using the Sys.Services.AuthenticationService methods; here Sys.Services.AuthenticationService.login/logout works just fine.Can someone please explain me the differences of both approaches and where can i find clear examples of both approaches?Many thanks.

View Complete Post

More Related Resource Links

Basic Web Forms Question Regarding Returning Html To The page


I have a web application I am working on but this is using simple web forms.

Long story short I want to create a commenting system similar to that of google sites for example.

All comments are saved to the database against a user id and submission id (meaning they are relevant to the page they are presented on).

Currently I am displaying them in a table using GridView which is kinda well annoying.

Is there anyway to return custom HTML from the server to a palceholder control or something of the like.

Basically run a for loop and fill up a placeholder control with html that will render appropriatelly

I know, its basic but I am a total noob.

Beginner question: get selected value of Html.DropDownList


Hi everyone, how are you doing!

I'm just started learning MVC 2. I went through the music store example (though I don't 100% get everything). Now I want to add some functions to the page to learn more. I added paging, and now I want to add search combo boxes (drop down lists). Basically, in the album list screen, I want to add 1 drop down list of genre. If user select 1 genre then click Search, the page should show all album of that genre only.

My problem is I don't know how to get the selected value of this drop down list. The approach I am using now is to get the selected value, then put it as parameter and redirect to Index (/StoreManager/Index?searchGerneId=x). I searched through many posts but couldn't find a solution that works for me. It is probably because I don't really get MVC yet and still try to do things the code-behind way. So please help me :) My code  for Index in Controller is below

public ActionResult Index(int pageNumber = 1, int searchGenreId = -1)
            var albums = from album in storeDB.Albums
                         join genre in storeDB.Genres on album.GenreId equals genre.GenreId
                         join artist in storeDB.Artists on album.ArtistId equals artist.ArtistId
                         orderby album.Title
                         select al

html/javascript (jQuery)/ajax patterns question


My presentation layer (UI) will consist of pure html (no webforms) javascript, jquery making calls to (Ajax enabled) WCF services. can I use MVC (in my presentation layer) in this context or not?


ASP.NET, HTML, JavaScript Snippet Support (VS 2010 and .NET 4.0 Series)

This post covers another useful improvement in VS 2010 - HTML/ASP.NET/JavaScript snippet support. Snippets allow you to be more productive within source view by allowing you to create chunks of code and markup that you can quickly apply and use in your application with a minimum of character typing.

Visual Studio has supported the concept of "snippets" for VB and C# in previous releases - but not for HTML, ASP.NET markup and JavaScript. With VS 2010 we now support snippets for these content types as well.

Maintain HTML Radio Button Selection Inside GridView After Postback

Long time ago I wrote an article about getting the value of the selected RadioButtons inside the GridView control. The code did not addresssed the postback issue which means that the selected radio button was cleared after the postback occurs.

Rendering ASP.NET Script References into the Html Header

One thing that I've come to appreciate in control development in ASP.NET that use JavaScript is the ability to have more control over script and script include placement than ASP.NET provides natively. Specifically in ASP.NET you can use either the ClientScriptManager or ScriptManager to embed scripts and script references into pages via code.

Getting value of Html.TextBoxFor(m => m.name)


Hi All,

I am new to Asp.net MVC 2. I am unable to get value for Html.TextBoxFor(m = > m.name) in view. I can get this value in Controller.

How to get this value in view.

Please help.

Some basic MVC question

  1. In regular asp net I can run (debug) the application but I can either "view in browser" that gives me the option to view the application and write code on same time.

In MVC I can't find this option.

  1. What is the basic DATA MODEL for working with SQL DB.

I mean with no any framework (entity framework, Sub sonic, Link to SQL etc')

I look for basic application that works with data but with no fw.

  1. What is the popular DB framework that working with data.
  2.  I am looking on  mvc series


C# Soup To Nuts  (the best series ever)


I watch some of the MVC video, seems that the music store is good but I have to wait to the other part.

Does any one know and recommend   a Microsoft MVC tutorial?





Embed Youtube inside Ajax Html Editor- problem



When inserting a simple embed of youtube inside the ajax editor, on firefox and chrome problems occur. On the other hand on internet explorer 8 everything works fine. I found this solution http://www.nopcommerce.com/boards/t/4228/bug-in-ajax-html-editor.aspx . 

My question is where do I find the DesignPanel.pre.js ?


Roderick Vella

Re-positioning an HTML container with javascript onresize with a Master page.


I have an HTML <div> container that I float to the right of a gridview.  When the browser window is maximized, it looks fine.  When minimized, the gridview positions below the floating container and most of the data is pushed off the bottom of the browser - you have to scroll down to see it.

If I position the floating container above the gridview it looks fine in a minimized window, but looks real bad when maximized.

What I want to do is use a javascript: onresize event to re-position the floating container up or down depending on the window.inner.width AND do it with a Master/Content page structure AND do it for only the one page where needed.

I can capture the onresize event and display the window dimensions but haven't figured-out how to do it with a Content page that still uses the Master page.  I think I'm having a very "thick" week...

- Tinker


adding a url to html img


I am having an html img tag in which the user is being shown images. However I now want to open a url when the user clicks my img. 
What do I need to do to be able to achieve this? 

VS 2010 HTML validation "in CSS" option - where the hell is it?


In VS 2008 there is a very useful feature of background HTML validation - it checks if CSS class name is valid i.e. it exists in one of the linked css files. But VS 2010 Express does not do that any more. And the relevant setting in Options->Text Editor->HTML->Validation->in CSS is not there. Ok, maybe they made it paid for option? VS 2010 Professional? Not there. Or maybe VS 2010 Ultimate? Not a trace.

1. am I blind?

2. they decided it is too convenient to use and removed it?

3. they will "introduce" it in SP1?

What is going on? That one thing made me move back to VS 2008 web developer.


Web Site to Web Application Question


I've been building web sites and for my next project I will be creating a web application.  I use a 'BasePage' class in all my projects but, since web applications do not contain the 'App_Code' folder, what is the best place/practice for the 'BasePage' class?



VWD rearranging HTML


Hey guys,

Have been VWD for a while now but VWD2010 seems to have one really annoying habbit. I'll write a whole load HTML with server tags and when I save, not always but quite often, VWD will squash all tags together in seemingly random arrangement completely removing my formatting conventions that make it easy for me to read. All the tags are still in the right order and makes no difference to how the page works, it just makes it really difficult to read quickly when scanning over it looking for a particular section.

For example:

        <asp:Panel ID="pnlConfirm" runat="server" Visible="false">
<asp:Table ID="tblConfBilling" runat="server">
<asp:Label ID="lblName" runat="server" Text="" />
<asp:Label ID="lblAddress" runat="server" Text="" />

connection string question from a newbie


when publishing  in the webmatrix dialogue it asks for "destination connection string" for my "database.mdf"

I was not sure what it was so I pasted this from my web.config file :

Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\database.mdf;Integrated Security=True;User Instance=True

it all published ok, but wont run, so I guess it has somthing to do with this connection string or some kind of configuration issue.

My question is this, What should go in the field for "Destination connection string"

Encoding en Decoding HTML



I stored in a database a ntext "<b>Hello</b>";

But when  I read it from the database I see <b>Hello</b> instead of Hello.

In the html source I see this: &lt;b&gt;Hello&lt;/b&gt;

Any Idea?


Html.PageLink not resolving ... any documentation?


Downloaded the code from here:


The Register.cshtml is having commented code which enables sending email to users for email verification.

This is the link not getting resolved properly in the email:

var confirmationLink = Html.PageLink("~\\Account\\Confirm", "click to Ccnfirm your Account.", new {token = token});

Mail.Send(email, "Confirm Your Security Demo Account", confirmationLink.ToString());

It is opening something like this: http://confirm/?token=tR9nWxnBPN34Kag

Note: I get the email but the link is not resolved properly.

Just for workaround and testing I did this and it worked:

var confirmationLink = "<a href='http://localhost:50620/Account/Confirm.cshtml?token=" + token.ToString() +"'> Please Confirm Your Account </a>";

If anyone can share some light on this Html.PageLink method and why is it not working?<

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend