|
well I got the answer now.
Its called the Sandbox Environment, which simulates the API Calls locally for the developers to test the working of their application
Rocky
You can't climb up a ladder with your hands in your pockets.
|
|
|
|
|
Hi guys I got a bit of a problem that has taken me days to try and sort out and I'm getting nowhere.
basically I have to servers that are setup in a DMZ, as a workgroup, one server is a Application Server and the other is a Database and File Server. I need to be able to be able to upload files from the application server the file server via a UNC path. but everything I have tried seems to fail.
I recieve errors along the lines of "can't find part of path", "incorrect user/password", etc.
I have tried a Myriad of approaches including creating a user account on both machines, and impersonating that account, to write, Created a Virtual Directory and used :
string SaveLocation =System.Web.Hosting.HostingEnvironment.MapPath ("~/webmedia/article/" + fn )
To get the UNC path, Stored the UNC path in the Web.config file, but nothing seems to work.
I haved scoured the net for any information, but seem to have got nowhere, I have found one or two articles but they basically tell me what I have tried. I was wondering if anybody knows of any other Tut's/atricles I could read.
I have included some of my code in the help somebody could spot an error
HttpPostedFile selectedPDF = ImageUploadFile.PostedFile;<br />
<br />
if ((selectedPDF != null) && (selectedPDF.ContentLength > 0) && selectedPDF.ContentType == "application/pdf")<br />
{<br />
try<br />
{<br />
string fn = System.IO.Path.GetFileName(selectedPDF.FileName);<br />
string dir = ConfigurationManager.AppSettings["docpath"].ToString();<br />
<br />
string SaveLocation = ConfigurationManager.AppSettings["devdocpath"].ToString() + fn;<br />
selectedPDF.SaveAs(SaveLocation);<br />
.....
-- modified at 8:47 Wednesday 7th November, 2007
I have tried doing a simple app here locally on my own network and haven't even tried using impersonation, but it just works
here is the sample code. I am completely baffled
try<br />
{<br />
HttpPostedFile theFile = FileUpload1.PostedFile;<br />
FileUpload1.SaveAs(@"\\Cyko\d\" + System.IO.Path.GetFileName(theFile.FileName).ToString());<br />
}
|
|
|
|
|
how should i use my code behind function thoug the javas script.currently what i am doing is , declaring the variable as public in the code behind , the on form load i am executing the fucntion and the function returns the value , and finally i fetch it form the source file using the following syntax,
<%=public var name%>
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
Sonia Gupta wrote: how should i use my code behind function thoug the javas script
What's a code behind function? Do you mean your ASPX cs or VB code? If so, you can't directly. One option is to use Ajax - and please, if you go this route, buy some books on it, try out the samples and watch some sample videos before you start posting questions on it.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
hi,
from the database i am getting a no like this( 2,3,6)...
i have a checkbox list and in the checkbox list i ahve to select the 2nd and 3rd and 6th checkboxes....
how can i do this in asp.net
|
|
|
|
|
Pretty easy, all you need to do is first split up the string of numbers:
string myNumberString = "2,3,6";<br />
string[] myNumbers = myNumberString.Split(',');
then just loop over them setting that item in the checkboixlist to Selected
int index;
for(string myNumber in myNumbers)
{
if(int.TryParse(myNumber,out index))
{
myCheckBoxList.Items[index].Selected = true;
}
}
|
|
|
|
|
Use the String.Spilit() method to change the string into One-Dimensional Array. Then iterate through the each Item of the CheckBoxList and check whether any Value in the string array matches with the Value of the ListItem. If yes mark that particular Item in the checkBoxList as selected/Checked.
string Value = "A,B,C";
ListItem lstItem = new ListItem();
string[] strArray = Value.Split(",");
foreach ( lstItem in chklstItem.Items){
for (Int16 I = 0; I <= strArray.Length - 1; I++){
if (strArray(I) == lstItem.Value) {
lstItem.Selected = true;
}
}
}
Regards - J O H N -
|
|
|
|
|
hi
i have assigned custom validator to textbox and calling on function to validate the string insert into the textbox on custom validator OnServerValidate="CheckImageFormat" event ..but it's not working properly.it works when page is postback..but i want to do the checking without page postback. have any idea then please help me
Naresh Patel
|
|
|
|
|
N a r e s h P a t e l wrote: OnServerValidate="CheckImageFormat"
"OnServerValidate" mean the validation has to go to server and came back to client.. so, the Postback will be occured... If you don't want postback, you can use "ClientValidationFunction" of Custom Validator.... Of course, that function should be written in clientscript...
|
|
|
|
|
i have a function defined in code behind.and want to call it in the source file, to make the hyperlink enabled or disabled.the function returns true or false.for the enabled funciton of hyperlink.the functio further access the database,from the database it fetches the boolvalue for the particular id .how should i call it for the enabled function of hyperlink.
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
Use the onclick method of the anchor tag to call javascript which redirects if appropriate. Set the href to #.
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 )
|
|
|
|
|
The situation is , i have a gridview that contains one rows ,
1.for hyperlink - for each row it has information for ten records , if the information pertaining to ten records are there in the database , then on clicking the hyperlink it shows the details of ten records , currently it shows what ever is there in database, i mean there may be 2 or 3 records information.
so that's y i want to restrict the user to first fill the complete information for ten records , only then u can view.
so i can either pop up a message box or i can make the hyperlink enable or disable.
in bothe the cases , i need to access the databas eto check the no of entries.
so what should i do?
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
-- modified at 7:24 Wednesday 7th November, 2007
|
|
|
|
|
You can make a hyperlink disabled by setting the href to # or an empty string. You can control it better by using onclick, then it can be dynamic.
You should get your info from the database when your grid is databound, and generate hyperlinks only if they are required. If you want it to update while the user is viewing the page, then you need to use AJAX, but I'd say that's overkill.
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 )
|
|
|
|
|
Christian Graus wrote: then you need to use AJAX
With Sonia this would be a can. of. worms.
|
|
|
|
|
i know pyramid building needs time.
Thank You Sir
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
Yes, but in your case you would ask where each and every block would need to be placed, rather than building on previous knowledge gained in laying out the base.
So, yes, I like your analogy.
|
|
|
|
|
Sonia Gupta wrote: so what should i do?
STFW!
|
|
|
|
|
Hi,
I have a function in javascript which is called on 'onload ' event of the body. This function, takes the values from windows.dialogArguments and assigns it to textbox1.text. After this assignment, I want to call a server side function. But my problem is that, the server side function gets executed first before javascript function gets executed. How can I make it sequential?
Here's the situation with example:
javascript function
function LoadFunc()
{
var val=window.dialogArguments;
document.form1.txtMessage.value=val;
<%databind()%> -- server side function.
}
This function is called on 'onload' event of the body tag. But the problem is databind() gets executed first!
Any help is greatly appreciated....
Thanks,
|
|
|
|
|
I would look into PageMethods, its an ajax thing which allows you to call server side code from javascript.
|
|
|
|
|
Is it an ASP.NET AJAX thing ? AJAX itself doesn't have anything like that AFAIK.
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 )
|
|
|
|
|
Sorry, should have mentioned that its part of the ASP.net AJAX framework, i am not sure if its included in any others.
|
|
|
|
|
I know about ajax and Icallback interfaces also,why dont you guys think in a different way...
|
|
|
|
|
this is my code---
protected void btnSearch_Click1(object sender, EventArgs e)
{
string strDropdown = drpdwnAnalystName.SelectedItem.Text;
string strSecurityCode = txtSecurityCode.Text;
string strFromDate = dtpFrom.Text;
if (drpdwnAnalystName.SelectedItem.Value == strDropdown && txtSecurityCode.Text == "" && dtpFrom.Text == "")
{
funSearchAnalyst();
}
if (txtSecurityCode.Text == strSecurityCode && drpdwnAnalystName.SelectedItem.Value == "" && dtpFrom.Text == "")
{
funSearchSecurityCode();
}
if (dtpFrom.Text == strFromDate && txtSecurityCode.Text == "" && drpdwnAnalystName.SelectedItem.Value == "")
{
funSearchFromDate();
}
funStyle();
funClear(); txtSecurityCode.Text = "";
drpdwnAnalystName.SelectedItem.Text = "";
}
fist if case only run. in second if cursor is not go to inside if condition.
it is directly go to 3 rd if condition there also not go to inside
if condition.
what wrong in this code
Gayatri
|
|
|
|
|
It's a repost
niki_nilu wrote: fist if case only run. in second if cursor is not go to inside if condition.
it is directly go to 3 rd if condition there also not go to inside
if condition.
what wrong in this code
Debug the application, put breakpoints and check what value you are getting.
|
|
|
|
|
niki_nilu wrote: drpdwnAnalystName.SelectedItem.Text = "";
Here you are replacing the text of the selected item. Is that really what you intended, or are you just trying to remove the selection?
niki_nilu wrote: fist if case only run. in second if cursor is not go to inside if condition.
it is directly go to 3 rd if condition there also not go to inside
if condition.
What are you trying to say? The only information that I managed to get from that is that there is some difference between the first and second time you run the code...
Experience is the sum of all the mistakes you have done.
|
|
|
|