Click here to Skip to main content
15,217,843 members

Comments by Sandip.Nascar (Top 110 by date)

Sandip.Nascar 27-Mar-15 13:35pm View
validating client side you can use onclientclick. check the code snippet sent above.

Calling server side code from client side, there are several ways-
-Use $(ajax)
-use __doPost Back
But still you don't need to call server side forcefully per your needs in the above e.g.

Sandip.Nascar 13-Mar-15 9:12am View
looks like they have given a callback URL or web service.
The documentation on how to call and send the request will be sent by them and you need to follow that.
Sandip.Nascar 27-Feb-14 17:01pm View
this is a separate question, how you pass the data to jframe.
post another question specific to your problem.
Sandip.Nascar 27-Feb-14 16:59pm View
why regex will change? The problem with this approach is if the html changes, your string parsing routine need a change to get the right data.
Sandip.Nascar 27-Feb-14 16:54pm View
which line you are getting the error?
If it is "ftpc.Login();", then something gone wrong at the ftp side (seems nothing wrong in the code)
check the credential is working with any ftp client or check directly from browser.
Sandip.Nascar 27-Feb-14 10:50am View
simple... get the html as text and use regex or other string operation to remove tags and get the actual text required.
Sandip.Nascar 23-Feb-14 12:15pm View
Inspecting querystring is very easy. Look at the browser url and you will see the querystring values there.

The url will look like .aspx?slno={some value}
Perhaps the value is null and that is why querystring returns null value.
Sandip.Nascar 19-Feb-14 12:41pm View
There is no other way other than manipulating the html with regex or some other way to extract actual result.
The drawbacks with this system is whenever the design layout change in future the routine to extract data will fail.
Sandip.Nascar 10-Jan-14 13:53pm View
It seems, some excetion occurred in GetData2 method.
Can you debug the method and identify the issue?
Sandip.Nascar 9-Jan-14 10:11am View
You are confusine with silverlight and plain web (ASP.NET).

I have told earlier, if you use silverlight, you cannot use ADO.NET.
Silverlight is a plugin, so the only way to talk to external sql server or any database is only with WCF/webservice.

For simple web, you can use sql server and
Sandip.Nascar 9-Jan-14 1:31am View
We have primarily 2 types of application we build in mobile device -
native and web. Another one is a mixture of native and web, we call it hybrid.

Now the point is, if you build a web applicatuion, you can connect to sql server through external ip and port.
But if you are trying to build it as native in windows phone, you cannot connect to external ip directly and use ADO.NET. You can connect to local sql CE or connect to external sql server using WCF or web service.

Same when you use silverlight. Silverlight cannot use ADO.NET.
Sandip.Nascar 8-Jan-14 8:37am View
have a look at the solution. I have updated the answer. This will give you a right path.
Sandip.Nascar 6-Jan-14 16:17pm View
I have added the PHP solution. Have a look.
Sandip.Nascar 31-Dec-13 7:27am View
As long as you use, you will have all the flexibility of the web application in mobile also. So, you can call web.config parameter and also use web method.
Sandip.Nascar 30-Dec-13 8:21am View
This is pretty simple.
Simplest way is to use replace function to replace all "," to "_"
Or use split function to split the text with "," and then use a for loop to concat with "_".

I can write down the code here but I would always suggest you guys to try it yourself first. This will help you in long term.
Sandip.Nascar 30-Dec-13 2:28am View
Did you replace the line -
CustomErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"
with the new one.

If you haver done so, you should not get the same error instead the actual error.
Sandip.Nascar 13-Oct-13 9:33am View
ensure you don't have multiple identical records.
Do you have any field for maintaining uniqueness like id (autogenerated) or uniqueidentifier (manually filled up to maintain uniqueness).
This is the key field that you must have to set.

I suspect, the problem is here.
Sandip.Nascar 12-Oct-13 21:24pm View
I will give you some hint to solve this -
Control tree is created in Page Init and view state is loaded here.
Though in Page Load, you can modify the control tree.

So, have a look again to each bits of code and see you have created the same control tree in the previous postback.
Sandip.Nascar 12-Oct-13 21:16pm View
Check the "PrintDetails" table and remove duplicate entries. As far fropm the code, check any duplicate order number and also see what constraint you define for each fields (specially order no., my rough guess).

Sandip.Nascar 22-Apr-13 0:03am View
What error you are getting? AT command works cool with smartphone. I have used it several times using Nokia Smartphone. I guess, it works also with other smartphones.

Port Name, you need to change to see, which one is working.
Sandip.Nascar 21-Apr-13 3:02am View
If you want to go for native application for each o/s, you need to target that o/s only and build the application.
With VS, you can create windows mobile native apps.
For android, Iphone, you can still use VS using mono.
You can check my application creating android Apps using mono C#.
Sandip.Nascar 23-Mar-13 18:38pm View
Do you want us to do your job free? lol
Please don't expect this here.
Sandip.Nascar 22-Mar-13 16:23pm View
You didn't detailed about what your doing. So, hard to reply.

But it seems, you memory gets eaten up fully. Try running the application and monitor memory usage from "Task Manager". So, if this is the reason, look at the code where the memory gets eaten up.

Sandip.Nascar 12-Mar-13 2:36am View
The below link in solution will give you in-depth knowledge on the error.
Most commonly the error occurred as there is something wrong in the code that executes on Startup.
Try to debug the code and get the exact cause where you are getting the error.

Sandip.Nascar 11-Mar-13 17:39pm View
check the link

before you publish, change the connectionstring in web.config.
If you are using local folder to publish, you can change in published folder and then upload.
Sandip.Nascar 11-Mar-13 16:09pm View
It will hamper your learning curve definitely, but another advantage, what effort you give yourself to find out problems, it worth in long run.
Sandip.Nascar 7-Mar-13 13:40pm View
This doesn't matter too much, provided you have to do all by yourself. If you get stuck with some issues, post here in code project. If you have genuine issues, it will be solved instantly.
Sandip.Nascar 7-Mar-13 13:30pm View
You need to build some real life application to get more confidence. You can google for some good web application and study the way it has been written.
You can even download some opensource application and study the code.
Sandip.Nascar 16-Nov-12 3:15am View
I have updated the answer with the corrected sp. Have a look at the issues you have in the sp in the answer section.
Sandip.Nascar 15-Oct-12 1:49am View
HTML Control without runat="server" means, it can be accessed only in client side. So, you cannot access a html control in code behind(server) if you don't use runat="server"

One work around could be trying with cookies. Using JS, add the value in cookies and in code behind access the cookie.
Sandip.Nascar 12-Oct-12 10:54am View
without number doesn't makes any sense. Put something like 9198XXXXXXXX instead of +91.....
check your service provider developer reference
Sandip.Nascar 12-Oct-12 8:44am View
You are getting invalid recipient, that means the issue is with the mobile number. My rough guess is the "+" sign. I think, in htc, + is encoded to somewhat different character before sending it to payment gateway.
Check your service provider development guy, whether + is is a must. I have used several service provider and I see + is not mandatory. You can go with the isd code + mobile number.
Something with the "+" character.
Sandip.Nascar 10-Oct-12 7:10am View
Yes you can add this. SMS is becoming defacto standard now a days.
You need to buy sms credits from any Service Provider. Code snippets for sending sms will be supplied by the service provider.
Sandip.Nascar 10-Oct-12 4:32am View
If the site uses HTTP POST to validate login, then only you can externally use the post method to login to the site.
Sandip.Nascar 10-Oct-12 1:28am View
You can make one application that can be used for both. You need to consider some design guidelines to work for both. Google it and you will find lots of info. But if you want to make it a professional application, you need to develop a separate application for mobile (a light weight version).
Sandip.Nascar 9-Oct-12 8:54am View
My suggestion, never pass html markup to another page. You are opening XSS security attack. Though, if you still want to pass, you will get a validation request error in the second page where you have passed. Still you can manipulate page directive to open validation request.
Sandip.Nascar 9-Oct-12 4:09am View
Did you check the path, whether it actually exists? Debug the code and see, if debugger hits the line PathInfo.CopyTo(string path)
Sandip.Nascar 8-Oct-12 6:29am View
I didn't get you. If you post 5.05, it will save as 5.05 and if you save 5.11, it will save as 5.11. Then what is the problem?
Sandip.Nascar 8-Oct-12 4:56am View
It should work. Check the data. You have used "AND" Operator, so check the data meets the filter criteria.
Sandip.Nascar 8-Oct-12 3:47am View
+ 5 from me
Sandip.Nascar 7-Oct-12 9:44am View
No, this can be only done through pages. Literally cross page posting can only be done in server side.
Sandip.Nascar 7-Oct-12 7:37am View
It's not too clear, what you want to do? Please be more specific of your problem.
Sandip.Nascar 7-Oct-12 4:32am View
Your question makes no sense at all.
Sandip.Nascar 7-Oct-12 4:30am View
If you want to explore for your own interest, then cost is a problem but for creating apps for client, 399 is a little money that client has no problem to afford. What comes free in Windows? Everything we use Win 7, VS, SQL Server, MS Office has a license cost.
Sandip.Nascar 7-Oct-12 2:51am View
You question is very vague to give any reply. Please post more specific problem of your issue.
Sandip.Nascar 7-Oct-12 2:00am View
There is no such gridview component in Android. You need to create your own control.
Sandip.Nascar 4-Oct-12 11:48am View
Your question is not specific. Download is as simple as pointing in a href link. What exactly you want?
Sandip.Nascar 2-Oct-12 5:58am View
As I have said, it is not advisable to open the security holes to access hardware id. Above all. accessing hardwareid is only applicable to web application running in LAN where you have physical access to machine. In WAN, this is not at all possible.

The only way, I see is the approach, I have given in the solution to track ip address.
Sandip.Nascar 2-Oct-12 4:51am View
Due to security, you cannot access hardware id. To do this you need to grant special permission which will lead your application to security hole.
Sandip.Nascar 30-Sep-12 5:39am View
Add this code,

public class showimage : IHttpHandler {
public bool IsReusable
get { return false; }
//add your code

This will work. For more details, google httphandler in
Sandip.Nascar 30-Sep-12 5:37am View
Add this code,

public class showimage : IHttpHandler {
public bool IsReusable
get { return false; }
//add your code

This will work. For more details, google httphandler in
Sandip.Nascar 30-Sep-12 2:18am View
This is nothing specific to jquery mobile. you need to optimize your query. Ensure, you only loads 20 records at a time and display. If you populate all records and then use a loop to display 20 records, your application performance will degrade drastically.
Sandip.Nascar 30-Sep-12 1:57am View
This is definite that the problem is in html with some tags. You need to observe minutely and have to fix the html issue.
Sandip.Nascar 30-Sep-12 1:29am View
Are you posting the url through mobile browser? After you enter the url and go further, what is the url (specially the querystring values)? Paste the querystring values here.

The url you posted under "Send by SMS" link seems to be incomplete
Sandip.Nascar 27-Sep-12 23:33pm View
No you cannot do it by timer or thread. ASP.NET differs a lot from Win Application from architectural point of view.
Sandip.Nascar 27-Sep-12 12:48pm View
There must be something in the style tag which makes the input control smaller. If you cannot figure it out, you delete the style for inpur or post the content within the style tag here.
Sandip.Nascar 27-Sep-12 11:30am View
Your question has no answer as we don't have a single clue what you want.
Sandip.Nascar 27-Sep-12 1:40am View
Did you used any theme? Could you please have a look, if the page is inherited from master page. If yes, check any css reference in master pages as well. This is definitely something related to css or inner style which gets updated automatically.

Also, have a look in the page itself, if there is any <style></style> tags.
Sandip.Nascar 27-Sep-12 1:03am View
Could you have a look that in asp page, you have any reference to stylesheet (.css)? If no stylesheet reference exists, then the problem is different. Let us know.
Sandip.Nascar 25-Sep-12 14:46pm View
I think, he has no question.
Sandip.Nascar 24-Sep-12 9:14am View
That means, some exception occurs in between. Try to log the exception and see what happens.
Sandip.Nascar 21-Sep-12 13:19pm View
Can you check increasing the executiontimeout value? This works fr me.
Sandip.Nascar 21-Sep-12 11:02am View
Google and find it yourself.
Sandip.Nascar 16-Sep-12 14:29pm View
Your question is not very specific. You need to read/write using BHO? BHO is Browser Helper Object. This is used to control IE. It is certainly not used to read/write data.
Sandip.Nascar 11-Sep-12 19:34pm View
You need to check the ASP.NET version in IIS (where you have uploaded your files.)
Sandip.Nascar 11-Sep-12 19:01pm View
Can you post your web.config. The error sometimes occur, when you have configured IIS wrong. The first one to see is the ASP.NET version you used in IIS.
Sandip.Nascar 30-Aug-12 11:02am View
Do one thing. After you run the page, view the source and see what you see the text id? Let us know.
Sandip.Nascar 30-Aug-12 10:30am View
The question is not very clear. Do you have the textbox with already generated id and you want to take the date part and the city/county part.
If so, why don't you take the id in a string and do some parsing routine to extract the 3 parts and do your next step?

Now, if you want to generate the id with this logic, again the datepart is quite straight forward and you concatenate city prefix and country prefix.
Sandip.Nascar 30-Aug-12 3:53am View
Is the scripmanager missing from your code before?
Sandip.Nascar 29-Aug-12 18:17pm View
It seems a caching issue. It often happens after we publish the file to the server.
Try clearing your cache and see.
Sandip.Nascar 28-Aug-12 14:32pm View
I don't know who is the guy downvoted the solution. Can you please come here and give the reason. If you have better solution, post your solution instead don't make nuisance of your power of voting.
Sandip.Nascar 28-Aug-12 14:25pm View
sorry, somehow the xml is not allowed in comments. Som the blank lines... check in the solution section.
Sandip.Nascar 28-Aug-12 14:21pm View
<question id="1" description="What is the capital city of India?">
<answer id="1" description="Mumbai" flag="0">
<answer id="2" description="Kolkata" flag="0">
<answer id="3" description="New Delhi" flag="1">
<answer id="4" description="Chennai" flag="0">

<question id="1" description="XML can be parse using?">
<answer id="1" description="xmlparse" flag="0">
<answer id="2" description="XmlDoc" flag="0">
<answer id="3" description="XMLGrabber" flag="0">
<answer id="4" description="XMLDocument" flag="1">

Sandip.Nascar 28-Aug-12 14:21pm View
Here is one sample xml which contains question, answers and right answer

<question id="1" description="What is the capital city of India?">
<answer id="1" description="Mumbai" flag="0">
<answer id="2" description="Kolkata" flag="0">
<answer id="3" description="New Delhi" flag="1">
<answer id="4" description="Chennai" flag="0">

<question id="1" description="XML can be parse using?">
<answer id="1" description="xmlparse" flag="0">
<answer id="2" description="XmlDoc" flag="0">
<answer id="3" description="XMLGrabber" flag="0">
<answer id="4" description="XMLDocument" flag="1">

Here flag represent the correct or incorrect answer.
Flag=1 is correct
Flag=0 is incorrect

Hope this helps.
Sandip.Nascar 28-Aug-12 13:38pm View
if this is not working, trap the error, if it is not 403, check whether your C: drive has a write permission.
Sandip.Nascar 28-Aug-12 13:36pm View
you need to put http:// other wise the url cannot be recognized.

Here is the code,
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim wc As New WebClient

Dim fileurl As String = ""
Dim filelocation As String = "d:\"

wc.Headers("Accept") = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
wc.Headers("User-Agent") = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.83 Safari/537.1"

wc.DownloadFile(fileurl, filelocation)

Catch exception As Exception
MsgBox("CAnnot Download")
End Try
End Sub
Sandip.Nascar 28-Aug-12 8:53am View
The error could be for several reasons. One probable reason - you might have some special characters in the url which cannot be identified. Your querystring should maintain the RFC3986 guideline. If it is not solved, type the url here.
Sandip.Nascar 26-Aug-12 2:07am View
Can you debug these lines,

string s = "";
s = comboBox1.Items[comboBox1.SelectedIndex].ToString();

Whether s is asigned with any value.

Sandip.Nascar 25-Aug-12 4:33am View
in the code above, just make the height of the button less than spacecount.
Sandip.Nascar 25-Aug-12 4:32am View
okay, then you make a loop and create button in each loop.
So, lets you get 100,101, 102.....

Here is the code
string str = "100,101,102,103,109,112";
string[] arrStr = str.Split(',');
int spacecount=10;
foreach (string s in arrStr)
if (s != string.Empty)
Button btn = new Button();
btn.Name = "btn_1";
btn.Text = s;//here you specify the button text
btn.Top = 50 + spacecount;//specify the top position
btn.Left = 50;
btn.Width = 200;
btn.Height = 200;

Sandip.Nascar 25-Aug-12 4:25am View
Can you trap the exception and let me know if you get any error?
//lblmsg.Text = "Email Sent Successfully...";
catch(Exception ex)
string str_ex = ex.Message;
Sandip.Nascar 24-Aug-12 15:49pm View
Who is the guy marking downvote here? Come here and write your comment for the reason for downvoting.

Don't do sabotage in the site.
Sandip.Nascar 24-Aug-12 15:32pm View
Yes the second one is also possible. This is how grid view works. It takes the data in page_load and then use the page index to paginate.

But when comes for millions of record, not a good approach to get the data in whole bunch.

You write sql statement to get the row_number and use the rowid to populate data from table.

Row_number() OVER (ORDER BY ...)
Thus you get the row number and using it you can fetch only the records you want, say from 1 to 10, 71 to 80 and so on...

You can also have a look into the links to get a complete idea of gridview

Sandip.Nascar 24-Aug-12 13:19pm View
Who said to you, text box doesn't have any onclick event?
<input type="text" id="text1" önclick="javascript:void(0);" />
Sandip.Nascar 24-Aug-12 12:05pm View
yes, when you refresh, postback occurs and thus the previous state disappears.
To cater this, you need to store the last state to regain it.
Sandip.Nascar 24-Aug-12 11:59am View
I agree with Christian, there is no need to split twice. I understand this will be a tiny bit of micro optimization. Think about several items with comma separated(30 or even more).

There are several guys who are just beginners and if they follow the split 30 times, you can understand the resource they are wasting.

So, we all better try to post the code as optimized as we can, so that the guys who are trying to understand by posting question can get into the right direction.
Sandip.Nascar 24-Aug-12 11:13am View
You gave a listbox, you query a table and populate the data into the list box. Say a beginners example - it shows color - white, black, red etc.
You have another table name it mobile. Mobile table contains Mobile Model and color.
Say - Samsung Model 1 : red color
Samsung Model 2 : white color
Nokia Model 1: black

Now, you need to show all mobile whose color is red or white or black.

So, in the listbox, you populate colors from table "color" and populate the listbox in page_load.

Now, if you select red, the selectedindex_change event will fire.
So, you need to pass the listbox text to the sql

something like, select * from mobile where color=@color;
@color parameter will be set by the selected value in listbox
So, if you select white, you will have the text "white", if you select black in the listbox, you have the value black and s on. Using the value you fire the sql to populate mobile data and show it in a control, could be a gridview.

Is this make sence?
Sandip.Nascar 24-Aug-12 2:20am View
Your question is not very specific. Do you want Gridview data to database or from database to gridview?
Sandip.Nascar 24-Aug-12 2:14am View
I think this is a version issue. Check which version you are using. You can get the latest dll from open source.
Sandip.Nascar 23-Aug-12 15:06pm View
Are you kidding?
Sandip.Nascar 23-Aug-12 9:12am View
What IE version you are using? This is suppose to run in IE 8 and above. Not sure on others.
Sandip.Nascar 23-Aug-12 9:04am View
You have confused with frontend and server. What I have understood, you are uploading file from client end to server and once the file is uploaded you need to delete the local files. Is it what you intend to do?
Sandip.Nascar 23-Aug-12 8:44am View
one thing to mention though not related with the actual problem,
ClientScript.RegisterStartupScript(this.GetType(), "Alert", "<script language = "'javascript'">alert('Please select state from List')</script>");

Here I seeextra double quote "'javascript'".
Sandip.Nascar 23-Aug-12 8:43am View
what is the difference with this code that Madhuri posted?
Sandip.Nascar 23-Aug-12 8:41am View
Please debug your code, specially the area where the list box populate code is written. In button click, is there any possibility of executing the code again?
Sandip.Nascar 23-Aug-12 4:32am View
Response.ContentType = "image/jpeg";? Do you still think, it works?
Sandip.Nascar 23-Aug-12 4:00am View
First of all, viewstate indeed will slow down the performance. Think about the number of data the view state will store and all that counts to client-server kb transfer. Its huge.

Second is where to store the current index and next index. Definitely not in cache. You can use hidden fields make it run t="server" to store those values.
Remember one thing, cache is not an alternative to store persistent data. It is used for separate purpose.

Hope this clears you confusion.
Sandip.Nascar 23-Aug-12 1:11am View
No, you cannot do this, nav-fragment-1 is linked with div id=fragment-1. To implement this is pretty straight forward. Just use a counter. Set it 1 before the loop. Use the counter to generate the id and increment the counter.
Sandip.Nascar 22-Aug-12 14:39pm View
close button, I leave this to you. Pretty straight forward to implement.
Sandip.Nascar 22-Aug-12 13:56pm View
This is a server side control. So, definitely this will not work.
Sandip.Nascar 22-Aug-12 9:53am View
check the port. Best idea is to open your gmail account and check the smtp settings.
Sandip.Nascar 22-Aug-12 7:05am View
check this link
Sandip.Nascar 22-Aug-12 6:39am View
Your child window in in aspx. Right?
If yes, when you moved to child window, you lost the 1st page state. You have no choice rather than to persist data. Have you tried Request.Forms
Sandip.Nascar 22-Aug-12 5:56am View
This is an e,g, there is no such domain name like
You need to create a page something like this, which will be opened only from email link. In the code behind check the id is available or not and update the status to one.

Remember, this is just for security (for activation) to stop spam
Sandip.Nascar 22-Aug-12 5:24am View
one thing I missed to mention.
If you do some repeatetive selection in 1st drop down, you will see the items in the drop down are increasing.

The reason is viewstate.
To cope up with this situation, add this code

protected void Page_Load(object sender, EventArgs e)
if (!IsPostBack)
DropDownList1.Items.Add(new ListItem("Sandip", "1"));
DropDownList1.Items.Add(new ListItem("Jon", "2"));
DropDownList1.Items.Add(new ListItem("Michael", "3"));

Sandip.Nascar 22-Aug-12 5:07am View
Why don't you access the div with id? If you have returned the object, what is the requirement to get the id?

In the e.g above,
var obj = document.getElementsByClassName("divclass");
Here obj is the collection of object (all objects that is linked with class class.
So, you need to iretae the object collection and see, which div you want.
But you need something to identify the unique div.
Sandip.Nascar 22-Aug-12 4:59am View
one thing to add, while you login, check user credential along with status field.
If status is 0, show message, "Sorry, you are not activated".
Sandip.Nascar 21-Aug-12 14:55pm View
I have given the simplest approach of dynamically loading data in client side.
You ca also use Ajax JSON to get the Json object and display the same, I have shown above. The only difference is you need the iterate the object and set data.
Sandip.Nascar 21-Aug-12 12:26pm View
Didn't get you actually. By different locations, did you mean to show data in different areas of the page. If yes you can place display controls in different areas as per your requirement and render with proper data.
Sandip.Nascar 21-Aug-12 9:11am View
check whether handle.ashx file is getting the image. Moreover, have a look whether the image is physically stored in the drive.