|
Hello,
Hope you all will be fine,I want to send multiple values through "location.href" after getting these values from DropDownList in ASP.net using C#, How can i do that? the DropDownList is in HTML not <asp:dropdownlist>. The code is like that;
location.href='addsuccess.aspx?color='+<%=colordropdown%>.options[<%=colordropdown%>.selectedIndex].value
Moreover I am calling this on "onClick" Event of an Image.
Hope you will understand,
Regards,
AbuBakar
|
|
|
|
|
Would it not need to be something more like this:
location.href='addsuccess.aspx?color='+<%=colordropdown.options[colordropdown.selectedIndex].value%>
|
|
|
|
|
Yes paddyboyd you are right it is working quite well but in this way i can only pass one value like color but in real case i want to pass more than one value so how is it possible to pass more than one values in following string ???????
location.href='addsuccess.aspx?color='+<%=colordropdown.options[colordropdown.selectedIndex].value%>
Regards
|
|
|
|
|
Separeate the values using the & character, e.g. create an url in the format:
addsuccess.aspx?color=3&something=42
---
b { font-weight: normal; }
|
|
|
|
|
hi friends,
i need to use lucene - wildcard search, but i don't know how to do it, is anybody has done this here before, please give me the piece of codings.and also please tell me, how to search if my starting characters is in German Language like ä.
kpsetty
|
|
|
|
|
|
Hi,
If I want to save an uploaded file to subfolderX I can use this:
objFile.SaveAs(Server.MapPath("subfolderX\" & savedFilename))
OK, no problems. But now I want to check that subfolderX exists, and create it if it doesn't. So I do this:
If Not System.IO.Directory.Exists(Server.MapPath("subfolderX")) Then
System.IO.Directory.CreateDirectory(Server.MapPath("subfolderX"))
End If
OK, no problem. This works.. on my local machine. When I try it on my ISP's server I get an error: "Could not find a part of the path e:"
When I contacted them they suggested I try hard-coding the fully qualified network path instead:
If Not System.IO.Directory.Exists("\\iisX\domains\x\....\subfolderX") Then
System.IO.Directory.CreateDirectory("\\iisX\domains\x\...\subfolderX")
End If
This works - but why doesn't Server.MapPath, esp given that it DOES work for saving files??!! This doesn't make sense to me...
I don't want to use the hard-coded version if possible, as it doesn't lend itself well to the application's portability.
Any deas, anyone...?
thanks
Phil
|
|
|
|
|
Try printing out what path the Server.MapPath() method returns, and see if this helps.
The reason the createdirectory doesn't work seems to have to do with the fact that your application is hosted on a different machine internally in the hosting company, since you have to give them the full networkpath.
How about it if you try with the Tilde "~" character (implying the current application)?
Server.MapPath("~/subfolderX")
Kind regards - Jakob
*********************************************
Three kinds of people in the world:
- Those who can count..
- Those who can't!
10 kinds of people in the world:
- Those who understand binary
- Those who don't
|
|
|
|
|
Jakob Lund Krarup wrote: Try printing out what path the Server.MapPath() method returns
I have - it gives "e:\...." (etc)
Jakob Lund Krarup wrote: How about it if you try with the Tilde "~" character
Same as above.
Jakob Lund Krarup wrote: The reason the createdirectory doesn't work seems to have to do with the fact that your application is hosted on a different machine internally in the hosting company, since you have to give them the full networkpath.
Weel, yes... but why then does
objFile.SaveAs(Server.MapPath("subfolderX\" & savedFilename))
work fine but
System.IO.Directory.CreateDirectory(Server.MapPath("subfolderX"))
not? That's the really puzzling thing.
thanks
Phil
|
|
|
|
|
I dont think anyone other than your hosting comany could possibly give you a definitive 100% accurate answer - but the chance of finding and speaking to a programmer there that understands such matters is slim!.
I can tell you that Server.MapPath works better the more of the path it has to go on. So, in your case you say that this works:
objFile.SaveAs(Server.MapPath("subfolderX\" & savedFilename))
so you are giving it quite alot to go on
Server.MapPath("subfolderX\myfilename.ext")
the one you say does not work has less to go on
Server.MapPath("subfolderX")
if you know the folder above subfolderx, you might try prepending that to give MapPath more of a hint, but I cant guarantee that will make any difference whatsoever.
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
Thanks - but didn't help.
This is so odd - the line that checks if the folder exists works:
If Not System.IO.Directory.Exists(Server.MapPath("subfolderX")) Then
because if I replace subfolderX with one that does already exist then it returns true; but if subfolderX doesn't then
System.IO.Directory.CreateDirectory(Server.MapPath("subfolderX"))
fails with a "Cannot find part of path" error. As I can create folders by hard-coding the network path I assume it isn't a permissions thing. (Unless there are different permissions to creating network folders from virtual ones..? Never have understood this side of things...) And saving files works.
J4amieC wrote: but the chance of finding and speaking to a programmer there that understands such matters is slim!.
Indeed....!
Oh well... thanks for trying folks
cheers
P
|
|
|
|
|
Hello There
There is a search form in my scenario in which user will fetch say 100 records in one go. and then he has button "Next 100". Now I am adding the next button dynamically . but the addhandler is not working.
Can any one help me how to make sure that handler should work. The code is
' I have a server side table in which I am adding rows and cells
Dim cellBtnPrevious As New System.Web.UI.WebControls.TableCell
Dim btnRow As New System.Web.UI.WebControls.TableRow
Dim BtnPrevious As New System.Web.UI.WebControls.Button
Dim BtnNext As New System.Web.UI.WebControls.Button
Dim BtnWidth As New System.Web.UI.WebControls.Unit(100)
BtnPrevious.Width = BtnWidth
btnNext.Width = BtnWidth
BtnPrevious.Text = "Previous"
BtnNext.Text = "Next"
AddHandler BtnNext.Click, AddressOf NextRecords
AddHandler BtnPrevious.Click, AddressOf PreviousRecords
cellBtnNext.Controls.Add(BtnNext)
cellBtnPrevious.Controls.Add(BtnPrevious)
btnRow.Cells.Add(cellBtnNext)
btnRow.Cells.Add(cellBtnPrevious)
tblContents.Controls.Add(btnRow)
'' The definition of one function is
Private Sub NextRecords(ByVal sender As System.Object, ByVal e As System.EventArgs)
'' code here
end sub
Thanks
Regards
Rizwan Bashir
|
|
|
|
|
I am defining relationship between datatables by using oracle as the backend.
It works fine in sql but in oracle it prompts an error "OBJECT REFERENCE NOT SET TO AN INSTANCE OF AN OBJECT"
my code for SQL is
Imports System.Data
Imports System.Data.SqlClient
Dim conn1 As New SqlConnection("Server=ibmserver;database=Northwind;User id=ADMINISTRATOR;Password=ADMIN")
conn1.Open()
Dim ds1 As New DataSet
Dim str1 As String = "select * from_categories"
Dim str2 As String = "select * from products"
Dim adapter1 As New SqlDataAdapter(str1, conn1)
adapter1.Fill(ds1, "categories")
adapter1.SelectCommand = New SqlCommand(str2, conn1)
adapter1.Fill(ds1, "products")
ds1.Relations.Add("categories_products", ds1.Tables("categories").Columns("categoryID"), ds1.Tables("products").Columns("categoryid"))
Dim categories As DataTable = ds1.Tables("categories")
DataGrid1.DataSource = ds1.Tables("categories")
DataGrid1.DataBind()
DataGrid2.DataSource = ds1.Tables("categories.categories_products")
DataGrid2.DataBind()
******************************************************************************
my code for oracle is
imports system.data.oledb
dim myConn as OledbConnection
dim myDa as oledbDataAdapter
dim myDa1 as oledbDataAdapter
dim drowParent as datarow
dim drowchild as datarow
dstDT = new dataset()
myConn=New OleDbConnection("Provider=MSDAORA.1;User ID=jewellman;password=jewellman;Data Source=orcl;Persist Security Info=False")
myDa = new oledbdataadapter("Select * from designTransactions",myConn)
myConn.open()
myda.fill(dstDT,"designtransaction")
myDa.selectcommand=new oledbcommand("Select * from designcustomerapprovel",myconn)
myda.fill(dstDT,"designcustomerapprovel")
dstDt.relations.add("DesignApprovel",dstDT.tables("designtransactions").columns("id"),dstDt.Tables("designcustomerapprovel").columns("categoryid"))
myConn.close()
|
|
|
|
|
Hi
Cloud you tell me if is possible to add some text in some bottome and this text to be dinamic.I need to change text from xml but i am not sure that this is a good practic.How to put text exacly into botton???
good bye
|
|
|
|
|
If it is a server control then you set the text like this:
YourButtonName.Text = "whatever";
if it is a HTML input tag then you set the value attribute.
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
But if i use imagine button???
|
|
|
|
|
Isn't it logical that you ahve to set a image then ?
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
why i whant to change text by xml??
|
|
|
|
|
You have a image button FFS. What text are you trying to set if there is a image on the button?!?!
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Sir/Madam
I want to show system month and year in two dropdownlist box
Balwan Singh
|
|
|
|
|
And?
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
I want to enabled/disabled dropdownlist on checked/unchecked of a checkbox in datagrid
but i want the above event to be done through javascript
Can anyone help me at the earliest.
|
|
|
|
|
Hi,
Below code solves your problem.
<script language='javascript'>
function newtest()
{
if(document.getElementById("CheckBox1").checked == true)
document.getElementById("DropDownList1").disabled = true;
else
document.getElementById("DropDownList1").disabled = false;
}
</script>
Add the below code inside checkbox tag..
OnClick="newtest()" 'removed' text has to be changed to 'onclick'
Hope this helps you...
|
|
|
|
|
|
Sir/Madam,
I want to select system month and year in dropdown list:
In detail i have two dropdownlist1, dropdownlist2 and 1st for months and second for years. it will automatically take month and year according to the system date. i have eneted items in months in character and year in numeric
Balwan Singh
|
|
|
|