|
Your server is where your VB code runs. Unless you're testng the site on the server machine, this means your code is going to stop execution, on the server, and no-one will see the message box in order to close it.
I recommend reading up on the way that ASP.NET works, this is reasonably fundamental stuff.
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 )
|
|
|
|
|
Guys, I have already spent an hour and this thing really making me crazy all i want is to Move Folder A folder B. What's going inthese code please help out
string path = @"C:\Documents and Settings\pic\My Documents\What";<br />
string target = @"C:\Documents and Settings\pic\My Documents\What2";<br />
<br />
Directory.Move(path,target);
|
|
|
|
|
|
Any help would be appreciated. How do I pass a variable e.g name to a sql stored procedure with variable declared @name? What is needed after code below? Will SET @name = uname work? (where uname is my variable)
<asp:sqldatasource id="SqlDataSource1" runat="server" connectionstring="<%$ ConnectionStrings:ClubSiteDB %>"
="" selectcommand="PagedAnnouncementList" selectcommandtype="StoredProcedure" onselected="SqlDataSource1_Selected">
Thanks
Steve
|
|
|
|
|
hi friend's
i want to allow my users to create subdomain automatically by entering a specific name and pressing a button.and then when users call his/her subdomain address,my program redirect him/her to specific address.
for example:
a user create a subdomain [USER.mysite.com]
and when he/she call this subdomain i want to redirect him/her to [www.mysite.com/001.html]page.
please help me to do it...or guide me that how to learn it
thank you
nobody help you...
you have to help you yourself
and this is success way.
|
|
|
|
|
how would you recieve the number returned by the RETURN @@IDENTITY SQL statement? (in C#)
-- modified at 15:25 Tuesday 2nd October, 2007
|
|
|
|
|
Add a parameter with direction set to ParameterDirection.ReturnValue to the command.
If the procedure also returns a result, you have to read the result (or discard it) before you can read the value of the parameter.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi.
Yahoo web site is developed with which technology and language?
yahoo pages have no extentions and have a complicated address. it's sufficient to take a look at links on it!
Best wishes
|
|
|
|
|
Hi All
i am developing a custom control in which i have to add asp.net controls like radio button , dropdown and other user controls also.
Please tell me any web site where i can find this things .
Also i have to register javascript in that user control
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Are you trying to add dynamically??
If so the following might help, i am using vb.net as language
dim rb as new RadioButton
rb.Text="Click here"
rb.ID= "Whatever"
if you are trying to run this code as part of UC then Me.Controls.Add(rb) will do, else if you are trying to add the control from a page Me."UserControlID".Controls.Add(rb) should do,
Hope this helps
|
|
|
|
|
hi,
i am having a radiobutton list on my page which is getting data from the database and displaying.
now i want to validate whether atleast one of the radiobutton is selected.
so i want a javascipt code to check whether they are checked or not.
i am not so good at javascript and i dont have time to explore also.
i am having a web application.
If anyone knows it,please share it with me.its urgent.
thanks in advance.
swarup
|
|
|
|
|
Hi Swarup
Take this javascript function and regisetr it on submit button.
'RadioButtonList1' is the name of radio button list that will be given by asp at runtime so check the name by viewing the source code of yoor html page
register your script in this way
Button1.Attributes.Add("OnClick", "javascript:Checkthis();");
<br />
<script language="javascript" type="text/javascript"><br />
<br />
function Checkthis()<br />
{<br />
var radiobuttonlist=document.getElementsByName('RadioButtonList1');<br />
var flag=0;<br />
for(var index=0;index<radiobuttonlist.length;index++)<br />
{<br />
if(radiobuttonlist[index].checked)<br />
{<br />
flag=1;<br />
}<br />
}<br />
<br />
if(flag==1)<br />
{<br />
alert("One is checked");<br />
}<br />
else<br />
{<br />
alert('none is checked give error');<br />
}<br />
<br />
}<br />
<br />
<br />
</script><br />
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Hi,
I have a problem with List(of Double). below is just an example what happens in List(of Double).
Example:
''Say i have a arraylist filled with data
Dim arrlst as new Arraylist
arrlst.add(10.50)
arrlst.add(Nothing)
arrlst.add(0.0)
''Now I am creating a generic type list with data in above arraylist by looping
Dim lst as new List(of Double)
For i as integer = 0 to arrlst.count-1
lst.add(arrlst(i))
Next
Finally when I checked the data in the List
lst(0) = 10.50
lst(1) = 0.0 ''Here there should be Nothing or novalue, Instead it was 0.0
lst(2) = 0.0
The second value lst(1) should be nothing, Intead it becomes 0.0 while Instantiating List object. Then whats the point in using this object for generic types.
Please help me out, I am in a situation to use only List or collection(Generic type) because of our companies new standard.
I would appreciate if you give me a example.
Thanks in advance
Abdul
|
|
|
|
|
Your issue is with the double type. It can not be null. If you switch this to a nullable type then you will get more of the results you are expecting.
Hope that helps.
Ben
|
|
|
|
|
Please let me know. how to switch this to a nullable type.
It would appreciable, if you give a small example.
Thanks
Abdul
|
|
|
|
|
I believe the correct syntax is:
List(Nullable(Of Double))
You should probably do some reading on nullable types before you go into this. There are plenty of articles out there.
Ben
|
|
|
|
|
As per your reply, I have used List(of nullable(of double)replacing arraylist. The reason I am asking about collection is a different case, because Chart FX datasource allow either arraylist or collection. if you give me declaration (example) for "collection" object of generic type that would be very halp full.
Thanks
Abdul
|
|
|
|
|
You should use Option Strict On , then the compiler would tell you what the problem is. Actually, that should be part of the company standard, rather than restricting the classes to use.
Compiling the line
lst.add(arrlst(i)) with Option Strict On will give you the error message that implicit conversion from Object to Double is not allowed. With Option Strict Off , the compiler will turn the line into:
lst.add(Convert.ToDouble(arrlst(i))) which explains why it turns your null value (Nothing) into a zero. Calling Convert.ToDouble with a null reference does actually return zero.
---
single minded; short sighted; long gone;
|
|
|
|
|
Thanks for your timely explanation. In another case I am binding arraylist as chart fx datasource, As i have to remove all arraylist from my application(as per my company new standards). the only choice I have is binding a collection of generic type like double, string.
So please give a small example or declaration part for building a collection of generic type.
Thanks in advance.
Abdul
|
|
|
|
|
I'm trying to update a drop down list (DropDownList2) after selecting an item from another drop down list (DropDownList1). Both are set to autopostback. I've set the update panel to both conditional and always with the same result. Nothing happens. However, it works without the update panel. So I suppose that is the source of my problem..
Please help me.
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
SqlConnection QADatabase = new SqlConnection();
QADatabase.ConnectionString = SqlDataSource1.ConnectionString;
QADatabase.Open();
SqlCommand command = new SqlCommand("SELECT Machines FROM Machines WHERE DeptID=" + DropDownList1.SelectedIndex ,QADatabase);
SqlDataReader reader = command.ExecuteReader();
while (reader.Read())
{
DropDownList2.Items.Add((string)reader["Machines"]);
UpdatePanel1.Update();
}
QADatabase.Close();
}
|
|
|
|
|
Clearly there are a couple of things wrong with your code. First you don't clear out the dropdownlist2 before the while statement. If you don't do this you will continue to add new items to your dropdown everytime. Second are you sure you select command is returning any rows. I am guessing it is not since you are setting the deptID = to the selectedIndex. I think you would want to set it to the SelectedValue, assuming you set up this dropdown with the selected value containing the deptid.
Hope that helps.
Ben
|
|
|
|
|
The SQL statement returns all Machines in the database with deptID = to the selected index. This is what I want, and I've tested by just putting the data into a string while debugging and it returns the correct values. It returns the correct values when not using the UpdatePanel. It just reloads the entire page. I just haven't implemented the UpdatePanel right.. (P.s I added code to clear the list, thanks for noticing that.)
|
|
|
|
|
|
Thanks Ben. I wasn't adding all of my controls and my data source to the update panel. Just the output control. I added the rest of the related controls and my data source and it updated correctly.
|
|
|
|
|
Glad you figured it out.
Ben
|
|
|
|