|
var sessionValue = <% Session["value"].ToString() %>
|
|
|
|
|
Hello,
Thanks Buddy...but its gives me the value undefined...
my code is as below.
(In JavaScript): var ImageUrl = <% Session["ImageUrl"].ToString(); %>
(In ASPX file): HttpContext.Current.Session["ImageUrl"] = "image" + "/" + "it-cover.jpg";
and In case of HiddenField how to do it?
HappyCoding
A key to every Solution
|
|
|
|
|
You need a single quotation (') around it. Try this
'<% Session["ImageUrl"].ToString(); %>';
|
|
|
|
|
It's impossible to access session variables from Javascript. The session variables never leaves the server.
If you want to use the value from a session varible, you have to copy the value from the session variable and put it in the generated html code, for example by outputting Javascript code that creates a variable that contains the value from the session variable, as Navaneeth suggested.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi all
I am learning MobileWebApplications
i created a web application it is working in my local system
but how can i publish to web i mean WAP
how can i convert my application to WAP
Thx in advance
keerthi
|
|
|
|
|
hi all,
iam adding rows to a datatable that i defined by code and then putting this datatable as gridview1 datasource:
gvSearch.DataSource = gridview1<br />
gvSearch.DataBind()
after binding the gridview1 is not loading anything but if i defined a new gridview by code and binded it, it will load the datatable.
My aim is to add a new row to a datatbale and let the user see the added coulmns in a gridview. Any ideas.
|
|
|
|
|
|
Gridview1 is a gridview created at design time.
<br />
If ViewState("dtSearch") Is Nothing Then<br />
dtSearch.Columns.Add("Table")<br />
dtSearch.Columns.Add("Field")<br />
dtSearch.Columns.Add("Operator")<br />
dtSearch.Columns.Add("Standard Table")<br />
dtSearch.Columns.Add("Value")<br />
dtSearch.Columns.Add("And/Or")<br />
End If<br />
<br />
'to maintain data<br />
' dtSearch = ViewState("dtSearch")<br />
Dim dataRow As DataRow = dtSearch.NewRow()<br />
<br />
dataRow(0) = radcTable.Value<br />
dataRow(1) = radcField.Text<br />
dataRow(2) = radcOperator.Text<br />
dataRow(3) = radcStandardTable.Text<br />
dataRow(4) = txtValue.Text<br />
dataRow(5) = ddlAndOr.SelectedValue<br />
<br />
If Not ViewState("dtSearch") Is Nothing Then<br />
dtSearch = CType(ViewState("dtSearch"), DataTable)<br />
dtSearch.Rows.Add(dataRow)<br />
Else<br />
dtSearch.Rows.Add(dataRow)<br />
End If<br />
<br />
ViewState("dtSearch") = dtSearch<br />
gvSearch.DataSource = dtSearch<br />
gvSearch.DataBind()<br />
|
|
|
|
|
my issue was solved by adding the gridview to a panel.
BUt another issue rised when attempting to set the datatble =viewstate when adding the second row.
I want to maintain the first row I inserted and add another row to the datatable
I tried 2 ways:
First way
dtSearch.columns.add()
dtSearch.columns.add()
dtSearch.columns.add()
For i As Integer = 0 To CType(ViewState("dtSearch"), DataTable).Rows.Count - 1
dtSearch.Rows.Add(CType(ViewState("dtSearch"), DataTable).Rows(i))
Next
Second way
dtSearch = CType(ViewState("dtSearch"), DataTable).Clone
in brief i want to maintain the result of datatable in viewstate and then add to this viewstate
NOT WORKING
|
|
|
|
|
The issue was solved
use the following code
Dim dtTemp As DataTable
dtTemp = CType(ViewState("dtSearch"), DataTable).Clone
For Each row As DataRow In CType(ViewState("dtSearch"), DataTable).Rows
dtTemp.ImportRow(row)
Next
|
|
|
|
|
Hi
I have a field in a database which is set as type Money.
However when I display this field in the gridview it just displays 0.0000
However in the database the value is 110.4000
Do I need to do some sort of conversion?
thanks in advance!
cheers
|
|
|
|
|
Hi guys
I have a gridview hyperlinkfield as show below:
<asp:HyperLinkField DataNavigateUrlFields="Item_Ref, Item_Description" DataTextField="Item_Ref" HeaderText="Item_Ref" SortExpression="Item_Ref" DataNavigateUrlFormatString="~/Main/RoomCompdets.aspx?firstvar={0}" Target="_new" />
How would i put into this code above the following code:
"window.open (this.href, 'popupwindow','width=850,height=700,scrollbars,resizable');return false;">
thanks in advance!!
|
|
|
|
|
Hello,
I want to call a crystal report from my .aspx webpage. I am using ASP.Net 2.0 and VB.Net
In my criteria, data will come in the crystal report from the stored procedure and I have to send the parameter to stored procedure.
Any help in this regard will be appreciated.
Thanks.
|
|
|
|
|
Following is the code i am writing to bing the gridview with the temporary table while updating the grid row.
TextBox quan = (TextBox)GridView1.Rows[e.RowIndex].FindControl("equan");
dt.Rows[e.RowIndex].ItemArray.SetValue(quan.Text, 4);
GridView1.EditIndex = -1;
GridView1.DataSource = dt;
GridView1.DataBind();
but the code is not updating the grid
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
Hi Sonia,
it is not clear to me what you exactly want.
TextBox quan = (TextBox)GridView1.Rows[e.RowIndex].FindControl("equan");
shouldn't this be something like
TextBox quan = ((TextBox)GridView1.Rows[e.RowIndex].FindControl("equan")).Text;
Do you have AutoGenerateColumns = true in you ASP GridView?
Was GridView1.EditIndex set to e.RowIndex before TextBox line?
|
|
|
|
|
Hi All
Please help me, I have been battling with the below task for sometimes now, I hope I will get help.
Here is what I am trying to do:
Create an excel file that a user can access from the internet, load in their browser, make changes, and save those changes to the file on the server, without having to download the file and FTP it back up?
I don't know if this is possible.
Thank you in advanced
khuzwayom
khuzym
|
|
|
|
|
No, it's not really possible.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thank you for the reply Christian.
Can you think of an alternative solution to this problem?
khuzym
|
|
|
|
|
i am using asp.net 2.0 C# .
due to data flow i manage to get row wise record column wise but that record show one null row .
i am fetching that record in datatable object and assigning to gridview
i want to know is it possible to remove datatable row where record is null then assign to gridview.
please help
regards
imran khan
|
|
|
|
|
I have a list of forms on the left side of my page, and to the right of that a GridView that displays information about reports linked to the form selected on the left. My problem is that the GridView only sizes for its contents, not its container, so when a form has only two reports selected, I have an ugly looking, fixed height forms list on the left, and a short little GridView on the right. How can I make at least the GridView border the same height as the list to its left? I've tried Height="100%".
|
|
|
|
|
I am able to place 2 ASP checkbox in a webpage. But it works differently.
If i select the first one, and then second both gets checked.
I want to check only one box..
How can i do this....?
Do i have to code for that in javascript or set any properties...?
SAJAN A PILLAI
C#.NET Programmer
TELESOFT INDIA PVT LTD...
BANGALORE
"Winners don't do different things. They do things differently. ...
|
|
|
|
|
sajan ss wrote: But it works differently.
If i select the first one, and then second both gets checked.
This is strange. Do you have any JS code running which does this ?
|
|
|
|
|
I am new to ASP .NET. We dont want to use Javascript.
IS there any other method.?
SAJAN A PILLAI
C#.NET Programmer
TELESOFT INDIA PVT LTD...
BANGALORE
"Winners don't do different things. They do things differently. ...
|
|
|
|
|
How can i convert an xml File into Image.
VanithaVasu
|
|
|
|
|
VanithaVasu wrote: How can i convert an xml File into Image.
Your question doesn't make any sense. How an XML file can be converted to image ?
|
|
|
|