Browsing articles tagged with " ASP .Net"

Get data from an SQLDataSource to a DataTable and Bind Grid

Fatal Error: get('adsPerSlot') in Admin Options don't exist (not an array)!

This week, I needed to bind a gridview to and SQLDataSource. The only problem is that I need to include extra rows. How to do this? First I removed the binding code to bind the grid directly from HTML (in gridview remove the DataSourceID attribute).

Then I wanted to get the data from the SQL Data source and convert to a data table to insert and update the table as needed. Next is the code to get the data… Continue reading »

ASP.Net 4.0 Validate Request

Fatal Error: get('adsPerSlot') in Admin Options don't exist (not an array)!

When creating a CMS sometimes you need to allow certain tags pass through the ASP.Net Validation. To allow tags be posted, in v2.0, you had to include the following tag in the page directive:

ValidateRequest="false"

But in .Net 4.0, this is not enough. You also need to include the next tag (httpRuntime) in the web.config file under <system.web>:

<system.web>
<compilation debug="true" targetFramework="4.0" />
<httpRuntime requestValidationMode="2.0" />
</system.web>

There is also other information on Error validation in .Net 4.0 here

Resources: here

ASP.Net | Read Values from Javascript

Fatal Error: get('adsPerSlot') in Admin Options don't exist (not an array)!

Today I started checking out some videos about Windows CardSpace and ASP.Net for logging in and I saw how he used javascript to get client side input and use it in ASP.Net in the C# code.

First you need to create a HiddenField on your webForm and name it TokenField (any name would actually do)

<asp:HiddenField ID=”TokenField” runat=”server” />

To set the Hidden Field value in JavaScript use the following code: Continue reading »

URLRewriter Submit Button Error | Intelligencia

Fatal Error: get('adsPerSlot') in Admin Options don't exist (not an array)!

Today I was using Intelligencia URLRewriter to use Search Engine Friendly URL’s to improve my site’s SEO.

The Problem?

All was working fine until I inserted a button in the page. When I clicked the button, the URL address showed the original URL and stopped working… the button didn’t even do the postback.

The Solution… Continue reading »

Return Array from Web Service using ScriptManager & Javascript

Fatal Error: get('adsPerSlot') in Admin Options don't exist (not an array)!

 This is used to call the Web Service using ASP.Net and Script Manager. Must be inserted in .aspx page. 

<asp:ScriptManager runat=”server” ID=”scriptManager”>
<Services>
<asp:ServiceReference path=”WebService/TestService.asmx” />
</Services>
</asp:ScriptManager>

This is the script to call the web service method and print the result on the form: Continue reading »

Calling Web Service From Javascript

Fatal Error: get('adsPerSlot') in Admin Options don't exist (not an array)!

Hi my post explains how to call web service frm java script using AJAX.

If the web service class on the server includes a web method that does not return data, you can call the web service without having to handle a response. This is the simplest web method call that can be made from the client. For example, your application has the following web method:

Continue reading »