Hiya,
I have the following code in a C# aspx page, but I keep getting the
error that 'ExceptionCateg oryId_' not found. Looks like the
QueryString is not returning anything.
<asp:DataGrid id=DataGrid1 runat="server"
AutoGenerateCol umns="False" DataSource ="<%#
Pfc.PfcCentreEx ceptions.Curren t.DataSet %>" DataMember
='ExceptionCate goryId_<%=Reque st.QueryString["Category"]%>'
AllowSorting="T rue" PageSize="5" bordercolor="Wh ite"
BORDERWIDTH="1p x" GRIDLINES="Hori zontal" CELLPADDING="0"
Width="630px">
Using this code to test, the value is displayed correctly on the same
page.
<script language="javas cript">
alert('<%=Reque st.QueryString["Category"]%>');
</script>
Can anyone point me to some clues on where I have gone wrong? I'm
obviously missing something here which i can't figure out. :( Anyone
with any idea to help will be greatly appreciated, thanks! 4 1594
Hi Landes,
<script runat="server">
protected void Page_Load(objec t sender, EventArgs e)
{
if (!IsPostBack)
{
DataGrid1.DataS ource = Pfc.PfcCentreEx ceptions.Curren t.DataSet;
DataGrid1.DataB ind();
}
}
</script>
<asp:DataGrid ID="DataGrid1" runat="server" AutoGenerateCol umns="False"
DataMember='<%# "ExceptionCateg oryId_" + Request.QuerySt ring["Category"] %>'
AllowSorting="T rue" PageSize="5" BorderColor="Wh ite" BorderWidth="1p x"
GridLines="Hori zontal" CellPadding="0"
Width="630px">
<Columns>
<asp:TemplateCo lumn>
<ItemTemplate >
a
</ItemTemplate>
</asp:TemplateCol umn>
</Columns>
</asp:DataGrid>
--
Milosz
"Landes" wrote:
Hiya,
I have the following code in a C# aspx page, but I keep getting the
error that 'ExceptionCateg oryId_' not found. Looks like the
QueryString is not returning anything.
<asp:DataGrid id=DataGrid1 runat="server"
AutoGenerateCol umns="False" DataSource ="<%#
Pfc.PfcCentreEx ceptions.Curren t.DataSet %>" DataMember
='ExceptionCate goryId_<%=Reque st.QueryString["Category"]%>'
AllowSorting="T rue" PageSize="5" bordercolor="Wh ite"
BORDERWIDTH="1p x" GRIDLINES="Hori zontal" CELLPADDING="0"
Width="630px">
Using this code to test, the value is displayed correctly on the same
page.
<script language="javas cript">
alert('<%=Reque st.QueryString["Category"]%>');
</script>
Can anyone point me to some clues on where I have gone wrong? I'm
obviously missing something here which i can't figure out. :( Anyone
with any idea to help will be greatly appreciated, thanks!
Example:
//Codebehind:
protected string test = "";
private void Page_Load(objec t sender, System.EventArg s e)
{
if(Request.Quer yString["test"]!=null)
test = Request.QuerySt ring["test"];
//Page (ASPX):
<script>
var test ='<%=test %>'
alert( test);
</script>
Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
"Landes" wrote:
Hiya,
I have the following code in a C# aspx page, but I keep getting the
error that 'ExceptionCateg oryId_' not found. Looks like the
QueryString is not returning anything.
<asp:DataGrid id=DataGrid1 runat="server"
AutoGenerateCol umns="False" DataSource ="<%#
Pfc.PfcCentreEx ceptions.Curren t.DataSet %>" DataMember
='ExceptionCate goryId_<%=Reque st.QueryString["Category"]%>'
AllowSorting="T rue" PageSize="5" bordercolor="Wh ite"
BORDERWIDTH="1p x" GRIDLINES="Hori zontal" CELLPADDING="0"
Width="630px">
Using this code to test, the value is displayed correctly on the same
page.
<script language="javas cript">
alert('<%=Reque st.QueryString["Category"]%>');
</script>
Can anyone point me to some clues on where I have gone wrong? I'm
obviously missing something here which i can't figure out. :( Anyone
with any idea to help will be greatly appreciated, thanks!
Hiya,
That worked!
Thanks alot! :)
<%= is a shortcut for Response.Write( ). In other words, it sends the
evaluated value to the client response stream. Using it in a pure
server-side definition, like DataMember, has no meaning. DataMember is
intented for things like table names. What are you trying to set it to?
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET] http://msmvps.com/blogs/egoldin http://usableasp.net
"Landes" <la****@gmail.c omwrote in message
news:11******** *************@p 10g2000cwp.goog legroups.com...
Hiya,
I have the following code in a C# aspx page, but I keep getting the
error that 'ExceptionCateg oryId_' not found. Looks like the
QueryString is not returning anything.
<asp:DataGrid id=DataGrid1 runat="server"
AutoGenerateCol umns="False" DataSource ="<%#
Pfc.PfcCentreEx ceptions.Curren t.DataSet %>" DataMember
='ExceptionCate goryId_<%=Reque st.QueryString["Category"]%>'
AllowSorting="T rue" PageSize="5" bordercolor="Wh ite"
BORDERWIDTH="1p x" GRIDLINES="Hori zontal" CELLPADDING="0"
Width="630px">
Using this code to test, the value is displayed correctly on the same
page.
<script language="javas cript">
alert('<%=Reque st.QueryString["Category"]%>');
</script>
Can anyone point me to some clues on where I have gone wrong? I'm
obviously missing something here which i can't figure out. :( Anyone
with any idea to help will be greatly appreciated, thanks! This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Arpan |
last post by:
A link has the following URL:
<a href="Page1.asp?cname=<%= Request.QueryString("cname") %>&cadd1=<%=
Request.QueryString("cadd1") %>&cadd2=<%= Request.QueryString("cadd2")
%>&cplace=<%= Request.QueryString("cplace") %>">Click</a>
Suppose the names in the above querystring have the following values:
cname="Danny"
cadd1="House 97"
|
by: Fawke101 |
last post by:
Hi there,
I have a ASP/SQL 7 application that displays data from various SQL7 Views
onto a ASP page.
A column of this data is displayed in ASP as hyperlinks and the relevent
data is put into a URL query string - so that the linked page is based on
this data ( a kind of "drill-down" effect) -
***
|
by: Amadelle |
last post by:
Hi all,
I have multiple frames which I would like to get the query string from within one of the subframes. But when I do
HttpContext.Current.Request.QueryString
or Request.QueryString
doesn't return the parent frame's querystring but the current page's querystring. I was wondering whether anyone knows how to get the parent frame's Querystring through either request object or through javascripting (I have been trying javascripting...
|
by: .NET Developer |
last post by:
Ok, this is probably simple but it's been driving me nuts.
If I have a URL like this: http://www.mysite.com/MyPage.aspx?MyKey
What code would I write to get that value "MyKey" out of the querystring?
Without the = and a value after it, is it considered a querystring value
still? I've tried Request.Params, Request.QueryString.Key, and nothing
is returning the value to me. I've driven down several levels into the
debugger and found the...
|
by: VancouverMike |
last post by:
Hi there,
I run into a very strange problem. I got the following url and am passing
information via query string. The problem when the "sin" key in query string
is blank, shown as in the following querystring, I got an error message
saying "Unterminated string constant" from IE 6.0 and asking me if I want to
debug. When I click Yes button, nothing happened and the page just shows up.
When I put anything as a value for "sin" key, IE...
| |
by: phl |
last post by:
Hello,
I have aspx(say page.aspx) page which uses javascript to submit a form
reload with some unicode characters,upon an button event e.g
page.aspx?param=value
I get this value in the codebehind and access it via
Request.Querystring property.
|
by: Landes |
last post by:
Hiya,
I have the following code in a C# aspx page, but I keep getting the
error that 'ExceptionCategoryId_' not found. Looks like the
QueryString is not returning anything.
<asp:DataGrid id=DataGrid1 runat="server"
AutoGenerateColumns="False" DataSource ="<%#
Pfc.PfcCentreExceptions.Current.DataSet %>" DataMember
='ExceptionCategoryId_<%=Request.QueryString%>'
|
by: Doogie |
last post by:
Hi,
I'm writing Javascript code to parse out a query string. I want to
handle the case where a parameter value may not be sent.
So consider a parameter called "State". If the user doesn't pass that
in if I do this:
var state = <%=Request.QueryString%>
This returns an undefined object that I can't seem to do any checks
|
by: =?Utf-8?B?ZGlzcGxheW5hbWU=?= |
last post by:
I have an ASP page with a button and other things.
When the button is clicked, it executes a javascript function which does:
document.Form1.method = 'post';
document.Form1.action = "AnotherASPpage.asp?p1=" + allFields1 + "&p2=" +
allFields2 + "&p3=" + bVar;
document.Form1.submit();
allFields1 represents all the fields in category 1 that user has selected.
The fields are delimited by comma.
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |