|
What kind of variable is usrStatus?
|
|
|
|
|
try putting the value in a string
<br />
string userStatus = dr["User_Status"].ToString();<br />
|
|
|
|
|
User Status in the database is a char(1). When I change it to not accept nulls I get the message that the value is too long. I am assuming that somehow MySQL sees a character in the field although there is none until I read it in with the data reader.
For now, I had to change the field in the database to a string and am reading it in as a string. Now I don't have any problems. But this solution is not ideal as I just want one character in that field. There is destined to be a user who will put more than one character in that field and right now the program allows them to.
|
|
|
|
|
Hi Everyone,
Just few minutes back i got cleared about the method DataBinder.Eval() method. But when i went through a code i came across a method Eval(string,string).
i can understand that this method is not the DataBinder.Eval(). It was used like <%#Eval("Name","~/UploadImages/") to the ImageURL property of asp:Image control.
Can anyone explain me about this method???
Thanks,
Srikanth
|
|
|
|
|
In ASP.NET 2.0, the DataBinder object that exposes the Eval() method is the default context for data binding expressions. You no longer have to explicitly refer to the object you want to evaluate.
This means that Eval() now has a much simpler syntax.
Paul
|
|
|
|
|
hai
i am an asp programmer.
i have two combo boxes optone and opttwo.
i have loaded values for optone from database
selected
<%
sqlPRO = "Select field1 From tablename"
set rs= conn.Execute(sqlPRO)
i=1
do while Not rs.EOF
%>
<%=rs("field1")%>
<%
i=i+1
rs.MoveNext
loop
rs.Close
%>
now i want to load a value for the second combobox opttwo
it's dependant on the first combobox optone
function setOptions(chosen)
{
var selbox = document.frm.opttwo;
selbox.options.length = 0;
selbox.options[selbox.options.length] = new Option('Select','oneone');
<%
strSQLQry = "Select field1 From tablename where ID='" & chosen & "'"
rs.Open strSQLQry, conn
rs.MoveFirst
While Not rs.EOF
%>
valFromList = "<%=rs("field1")%>";
selbox.options[selbox.options.length] = new Option(valFromList,'oneone');
<%
rs.MoveNext
Wend
rs.Close
%>
}
this code shows an error.i can't get the javascript variable into asp.
if anyone known please help me
Thanks and Regards
Ganesh Mohan
|
|
|
|
|
The problem is that the code is not at all executed in the order that you think it is. All ASP code is executed on the server, then the page is sent to the browser, and the client code is executed.
The ASP code that you have put inside your javascript function is always executed when the page is created, not when the javascript function runs.
To run server code that uses values from the client code, you have to send another request to the server and send the values along in the request. You can send values either in querystring or in form data.
To populate a second select box depending on the first, you can either reload the page to do the request to the server, or do the request behind the scenes using techniques like AJAX.
---
single minded; short sighted; long gone;
|
|
|
|
|
hai
thanks for the reply.
Is it possible using hidden field?
|
|
|
|
|
ganeshMohan wrote: Is it possible using hidden field?
Yes.
---
single minded; short sighted; long gone;
|
|
|
|
|
hai
please give me a example code?
|
|
|
|
|
Hi all,
I am having static data and this data is displayed in html table using Javascript. Now I want to show the database values using same logic, problem is that how to bind that data to html table and how do I assign values to javascript file which I have included in my aspx page.
Any suggestions??
Thanks in advance...
|
|
|
|
|
can anyone tell me what are the differences between setup project and
setup wizard.........?
Thanks in advance,
pavan...
|
|
|
|
|
None - I've never seen a setup program that's not a wizard.
You don't setup an ASP.NET site typically, so why did you ask that here ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
I have a textbox in the main page and a image control. Onclicking on the image one popup window is opening where there is a calendar control. On double clicking on the date it should come in the textbox of the main page.
How can i do that.
Thanks & Regards
Mishra
|
|
|
|
|
Use javascript function:
On calender Selection changed do this
control.Value = calDate.SelectedDate.ToShortDateString();
Response.Write("<script language='javascript'>window.returnValue='" + calDate.SelectedDate.ToString("dd/MM/yyyy") + "';window.close();</script>");
|
|
|
|
|
PASS TEXT BOX ID TO POPUP WINDOW.
Function calendar(ID)<br />
{<br />
window.open("calendar.aspx?ID="+ID,......,.......,........);<br />
}
NOW IN CALENDAR.ASPX.CS PAGE,WRITE BELOVE CODE TO GET SELECTED DATE ON SELECTIONCHANGED EVENT
protected void Calendar1_SelectionChanged(object sender, EventArgs e)<br />
{<br />
<br />
Response.Write("<script language = javascript>opener.document.getElementById('"+Request.Qeurystring["ID"]+"').value='" + Calendar1.SelectedDate.ToShortDateString() + "'; self.close();</script>");<br />
}
yOU WILL GET SELECTED DATE IN TEXTBOX.
PLZ VOTE IF THIS POST WILL BE HELPFUL
bEST rEGARD
pATHAN
---------------------------------------------------
|
|
|
|
|
Thank you very much, Its working fine.
Thanks & Regards
Mishra
|
|
|
|
|
Imran Khan Pathan wrote: Response.Write("opener.document.getElementById('"+Request.Qeurystring["ID"]+"').value='" + Calendar1.SelectedDate.ToShortDateString() + "'; self.close();");
It isn't good practice to use Response.Write to inject Javascrip code into your ASP.NET web page. Use the functionality exposed by the Page.ClientScript object.
Regards
Paul
|
|
|
|
|
Anyy body tell COM type dll use in asp.net or not
Piyush Vardhan Singh
Senior Software Engineer
TAS NewDelhi
India
|
|
|
|
|
Piyush Vardhan Singh wrote: COM type dll use in asp.net or not
Yes. Sure You can use your COM component in Asp.Net.
Regards,
Abhi
|
|
|
|
|
hey friend
i am adding uccp.dll(com based library) in asp.net
when i new (Public _mUccp As New UCCPLib.UccPlatform()) this dll then error occurred Error:-
Retrieving the COM class factory for component with CLSID {E0AA501C-CAD6-4D93-A5A7-DAF1C0B30F32} failed due to the following error: 80070005.
if i take reference on run time(dynamically)
like this(Dim asas As Assembly = Assembly.LoadFile("C:\Uccp.dll"))
then error occurred
Erroe:-
The module was expected to contain an assembly manifest. (Exception from HRESULT: 0x80131018)
can u help me on this topic please
Piyush Vardhan Singh
Senior Software Engineer
TAS NewDelhi
India
|
|
|
|
|
DID YOU TRY IN GOOGLE.
CHECK OUT lINK1
or
lINK2
bEST rEGARD
pATHAN
-- modified at 0:23 Saturday 22nd September, 2007
---------------------------------------------------
|
|
|
|
|
links are not working
Piyush Vardhan Singh
Senior Software Engineer
TAS NewDelhi
India
|
|
|
|
|
Hi everyone,
can anyone give me a clear picture about the DataBinder.Eval(). i need to know where and how it should be used?? what it is all about???
i tried searching for it in google but couldnt find a clear article.
Kindly help me out
Thanks,
Srikanth
|
|
|
|
|
Sri_3464 wrote: can anyone give me a clear picture about the DataBinder.Eval().
we need to somehow be able to, at render time, determine the value of the data in the databound statement and decide how to alter the output based on the value. Realize that the databinding statement, DataBinder.Eval(Container.DataItem, "ColumnName"), produces a string output based on the value of the particular database column name. The databinding syntax, <%# ... %> simply emits the string produced, much like <%=...%> in classic ASP. Hence, we can create a function that accepts a string (the output of DataBinder.Eval(Container.DataItem, "ColumnName")), examines the string and alters it, if necessary, and then returns the string, which will be emitted by the <%# ... %> syntax.
SSK.
|
|
|
|