|
hi
can anybody tell where to find a web service for populating dropdown list as following:
1st list: list of all countries
2nd list : list of states from above selected country
3rd list : list of cities from above selected state
|
|
|
|
|
|
hey thanks....
but plz tell me how to program the three lists so that i get the corresponding state and city acc to the selected country
|
|
|
|
|
You would need XML that contains a country Id that can be used to filter the list of states, etc.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Please refer to Cascading DropDown from Ajax Control Toolkit.
You will get the sample code and example also.
|
|
|
|
|
I am having one master page with left side treeview. On click of node I am calling one HTML page. But page is opening without masterpage(Page should open right side with masterpage). So please how do I call HTML page?
Thanks
|
|
|
|
|
You have to set the target of that node.
|
|
|
|
|
siddisagar wrote: Page should open right side with masterpage
By setting target, you can force the html page to open in the target frame, but MasterPage you can't bind directly with HTML page.
You can use master pages easily with .aspx page.
|
|
|
|
|
when i am using file upload control in update panal then its showing blank file name . but when same code i run without upadate panal then its showing proper file name.. what is the problem in that any one knows then pls give advice thnx in advance
|
|
|
|
|
it is problem with postback....
in update panel there is a tag called triggers use that.
|
|
|
|
|
Dear anu...
Do like this....
<triggers> <asp:asyncpostbacktrigger controlid="ddlCategory" xmlns:asp="#unknown">
<asp:postbacktrigger controlid="btnAdd_UpdateBannerAds" xmlns:asp="#unknown">
Regards
Rajeesh Meleparambil
|
|
|
|
|
where i have to right this code......
|
|
|
|
|
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ddlCategory" />
<asp:PostBackTrigger ControlID="btnAdd_UpdateBannerAds" />
</Triggers>
</asp:UpdatePanel>
|
|
|
|
|
|
Hello
Problem: Upload all the file in a folder to Server using JavaScript / web service
I was trying to upload all the files from the specified folder from the client machine to the server.
At the client side, I used JavaScript to read the entire file from client machine
While looping through each file in the folder I call web service and pass the file content. I use webservice.htc to call web service
<html>
<head>
<title>Upload Files</title>
<script language="JavaScript">
var iCallID;
function InitializeService()
{
checkFile();
}
function ShowResult()
{
alert(event.result.value);
}
function checkFile()
{
var found=0;
var foldobj=new ActiveXObject("Scripting.FileSystemObject");
if((navigator.userAgent.indexOf('Win') != -1))
{
var myfolder=foldobj.GetFolder("c:\\Temp");
var z=myfolder.Files.Count;
var fil_col=myfolder.Files;
var en=new Enumerator(fil_col);
for(;!en.atEnd();en.moveNext())
{
var objFileIO = foldobj.GetFile("c:\\Temp\\" + en.item().Name);
var textStreamObject = objFileIO.OpenAsTextStream(1,-2);
var strFileContent = textStreamObject.ReadAll();
//Another code
var streamIO = objFileIO.OpenAsTextStream();
var strTransform = new Array();
for (i = 0; i < objFileIO.Size; i++) {
var strContent = streamIO.Read(1);
// strTransform[i] = strContent.charCodeAt(0);
strTransform[i] = strContent;
}
streamIO.Close();
var StrPath, StrFile, byteStream;
StrPath= "C:\\Test\\";
StrFile = en.item().Name;
service.useService("http://localhost:46967/MyWebService.asmx?wsdl", "UploadDocumentService");
service.UploadDocumentService.callService("UploadDocument",StrPath,StrFile,strFileContent);
//service.UploadDocumentService.callService("UploadDocument",StrPath,StrFile,strTransform);
}
}
return found;
}
</script>
</head>
<body onload="InitializeService()" id="service" style="behavior:url(webservice.htc)" onresult="ShowResult()">
</body>
</html>
At the server, I will write the file back to the specified folder location using FileStream.
[WebMethod]
public string UploadDocument(String strDocPath, String strFile, byte[] document)
{
try
{
string FullPath;
FullPath = AppPath + strFile;
// *** Write to file ***
// Specify file, instructions, and privelegdes
System.IO.FileStream file = new System.IO.FileStream(FullPath, System.IO.FileMode.Create, System.IO.FileAccess.ReadWrite, System.IO.FileShare.Write, document.Length);
file.Write(document, 0, document.Length);
// Close file
file.Close();
}
catch (Exception)
{
throw;
}
return "Success";
}
Here is the problem it works fine for the text file as I use FileSystemObject and OpenAsTextStream .
But it if tried to upload .doc file, jpeg file etc.(I mean binary file )it fails, the file created with same size, but not able to open these files, says ‘file is corrupted ‘
Can I use
//Test another method
var adoStream, stream;
adoStream = new ActiveXObject("ADODB.Stream");
adoStream.Open();
adoStream.Type = 1;//adTypeBinary;
adoStream.LoadFromFile("c:\\Temp\\" + en.item().Name);
stream = adoStream.Read();
adoStream.Close();
//End
But I have some issue like will “ADODB.Stream” work on IE 5.1 or later. ?.
Any help is greatly appreciated..
|
|
|
|
|
Hi, I'm getting a null reference exception on the following code, which is attempting to create a word document. The error is occuring at 'wordDoc.Activate'.
I have Word 2007 installed on both the server and on my machine, but I'm not too sure on how the interop stuff works. If someone can point me in the right direction, that would be great.
Imports Word = Microsoft.Office.Interop.Word
....
Dim wordApp = New Word.ApplicationClass()
Dim wordDoc = wordApp.Documents.Add
wordApp.Visible = True
wordDoc.Activate()
wordApp.Selection.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphLeft
wordApp.Selection.TypeText("Some text")
wordApp.Selection.TypeParagraph()
|
|
|
|
|
from code begind?
are there any examples?
|
|
|
|
|
|
Hello Everybody
My ArrayList (name aList) is Follows:
aList(0) = 4, 5
aList(1) = 6, 7
aList(2) = 8, 9
What I want to call function as below:
Dim aa() As String
for i = 0 to aList.Count - 1
aa(i) = myFunction (aList(0,0), aList(0,1), aList(1,0), aList(1,1))
Next
Every Single time myFunction will take 4 values from aList
For Example:
i = 0 , will take value from aList(0) and aList(1)
i = 1 , will take value from aList(0) and aList(2)
i = 2 , will take value from aList(1) and aList(2)
Please tell me some logic
Thanks
Sarfaraj
Sarfarj Ahmed
|
|
|
|
|
your example does not give a complete picture, or does it?
Do you have only 3 items in your array or can it be more? ( I'm inclining to think more)
what is the correlation between the example you have with an array of 10 items?
will double loop work for your?
for i = 0 to aList.Count - 2
for j = i+1 to aList.Count - 1
aa(i) = myFunction aList(i), aList(j)
this will produce something like this
aList(0) , aList(1)
aList(0) , aList(2)
aList(1) , aList(2)
Yusuf
|
|
|
|
|
Dear Yusuf
Thanks for your reply.
There will be three items into aList. Like below:
aList(0) will keep two values 7 and 8
aList(1) will keep two values 4 and 6
aList(2) will keep two values 5 and 9
I have to call a function which will take 4 values from aList (every single aList row keep 2 values)
First Time I have to send value from aList(0) and aList(1)
Second Time I have to send value from aList(0) and aList(2)
Third Time I have to send value from aList(1) and aList(2)
Thanks
Sarfarj Ahmed
|
|
|
|
|
more senario
for i = 0 to aList.Count - 2
j= i + 1 to aList.Count - 1
aa(i) = myFunction (aList(0,0), aList(0,1), aList(1,0), aList(1,1)
like this
Sarfarj Ahmed
|
|
|
|
|
|
Array list is nothing but collections of item, you can not store 2 value on same index.
|
|
|
|
|
Kunal Pawar wrote: Array list is nothing but collections of item, you can not store 2 value on same index.
So, if it is a collection of item, can't you have an item composed of many things which is stored on single index.
' Creates and initializes a new ArrayList.
Dim myAL As New ArrayList()
myAL.Add("1,2")
myAL.Add("3,4")
myAL.Add("5,6")
I'm not saying this is the most efficient way of doing it, just showing you that you can store more than one item in an index, by creating collection.
Yusuf
|
|
|
|