|
the code is working.. properly.
there is no issue in your code.
but the in the BtnReset set the CausesValidation="false" and in BtnSubmit set the CausesValidation="true"
because no need of validation on Reset button.
Use Same .net framework version on server and your development environment.
(as you said that it is working on local) so its the issue on server.
|
|
|
|
|
hello Zafar,
Finally, the problem is solved.
the problem was with the server.
thanx a lot for your support...
|
|
|
|
|
you are welcome
|
|
|
|
|
hi sir
please help me
actually sir i want little support from your side
the problem is that
i want to maintain the checkbox selection state for paging.
i mean to say that if i select two checkbox on gridview and then i go to next page and there i again select one checkbox then i return on first page then what ever the checkbox i have selected from first page should be checked.i am using following.
protected void pageindex_changing(object sender, GridViewPageEventArgs e)
{
GridView1.PageIndex = e.NewPageIndex;
RememberOldValues(GridView1, "chk2");
refresh();
}
private void RememberOldValues(GridView gridview, string checkboxname)
{
ArrayList categoryIDList = new ArrayList();
int index = -1;
foreach (GridViewRow row in gridview.Rows)
{
index =Convert.ToInt32 (gridview.DataKeys[row.RowIndex].Value);
bool result = ((CheckBox)row.FindControl("chk2")).Checked;
// Check in the Session
if (Session["CHECKED_ITEMS"] != null)
categoryIDList = (ArrayList)Session["CHECKED_ITEMS"];
if (result)
{
if (!categoryIDList.Contains(index))
categoryIDList.Add(index);
}
else
categoryIDList.Remove(index);
}
if (categoryIDList != null && categoryIDList.Count > 0)
Session["CHECKED_ITEMS"] = categoryIDList;
WebMsgBox.Show(Session["CHECKED_ITEMS"].ToString());
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
RePopulateValues(GridView1 , "chk2");
}
private void RePopulateValues(GridView gridview, string checkboxname)
{
ArrayList categoryIDList = (ArrayList)Session["CHECKED_ITEMS"];
if (categoryIDList != null && categoryIDList.Count > 0)
{
foreach (GridViewRow row in gridview.Rows)
{
int index = Convert.ToInt32 (gridview.DataKeys[row.RowIndex].Value);
if (categoryIDList.Contains(index))
{
CheckBox checkbox = (CheckBox)row.FindControl("chk2");
checkbox.Checked = true;
// row.BackColor = Color.FromName("#FFAA63");
}
}
}
}
chk2 is checkbox column id.
thanks
hi brij sir
there was an error Page Not Found
please give anything else
hi abhijit sir
yes i think i am facing problem to open this url.
please send me the url .
modified on Saturday, July 18, 2009 3:39 AM
|
|
|
|
|
Have a look to this Article.
Hope this help you
|
|
|
|
|
vikas shukla wrote:
there was an error Page Not Found
please give anything else
What do you mean by Page Not Found ? The link is valid and this is the actaul answer thar you are looking for.
Are you facing any prolem to open that url ??
|
|
|
|
|
vikas shukla wrote: yes i think i am facing problem to open this url.
please send me the url .
check here
Maintaining States of Selected CheckBoxes in Different Pages inside the GridView
or Plain text URL
http://www.codeproject.com/KB/webforms/States_of_CheckBoxes.aspx
Note : If you need to give reply Some one Message, then just reply on that message, please dont modify your own mesaage. If you modify your message how would I know that you have some more query, better just replied on the answer.
|
|
|
|
|
thanks for your suggestion i will keep it remember.
|
|
|
|
|
No Problem. So does that link worked for you ?
|
|
|
|
|
Do as abhijit says.And you can use that link and can use that for maintaining the checkbox status.
|
|
|
|
|
Hello everyone,
I have placed a User Control inside a modal popup & it is working fine. There is also one Cancel button on the user control which is meant for closing the popup. Since ,it is inside the user control ,I am not getting how to make it the CancelControlId for the modal popup. Do anybody have any idea,how can I achieve this?
|
|
|
|
|
What your cancel button does? It just closing the modal or done any othe operation ?
|
|
|
|
|
Thanx for replying,
The cancel button is not doing anything,it simply needs to close the popup and that too without going to server side. It could be done by setting,that button's id as cancelButtonId of modal popup.But since the button is not on the same page.It's rather inside the user control on that panel, I am not able to use this utility as well.
Please reply.
|
|
|
|
|
Hi,
I wrote the following code in the page load event
string path = clientServerXRef1.GetDownloadpath(company.ToUpper());
System.IO.FileStream fs = null;
fs = System.IO.File.Open(path + company.ToUpper() + "_" + projectID + ".mpp", System.IO.FileMode.Open);
byte[] btFile = new byte[fs.Length];
fs.Read(btFile, 0, Convert.ToInt32(fs.Length));
fs.Close();
Response.AddHeader("Content-disposition", "attachment; filename=" + projectID + ".mpp");
Response.ContentType = "application/octet-stream";
Response.BinaryWrite(btFile);
and called it inside frame to downlaod the file from the same page. I do other process like setting flag and messages in the database to make sure this is downloaded for the first time. If it is for the second time i supposed to give some different messages in the label.
Here it what happens
When the file downloads, it is getting blocked by the popup blocker. When i click and allow download, it reloads the page, hence it is showing the message for the second download rather than showing the first one.
Regards
cmrhema
|
|
|
|
|
This is pretty lousy code. The way you build the path is prone to error. Most of it could be replaced with Response.BinaryWrite, which would remove load from your server.
You can't detect if a popup is blocked, so yuo need to change your approach
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Okay, ... my first attempt at a .net web service.
VB.net visual studio 2005, ...
on my workstation, it runs fine with View in Browser.
But on hosting service, I get the Parsing Error "Could not create type Filedownload.
On hosting service, if I put vb code in asmx file and remove codebehind statement, it does work.
Like it cannot find the codebehind code.
Tried the compiled file and dll, and .vb file.
Tried putting them in same folder as .asmx with codebehind = filedownload.vb (so not have to have access and find another folder).
Called hosting service, verify running .net 2.0.5
Checked/changed access to subfolders as full access.
Tried using actual www......\etc. ... host name then folder name.
How do I know Vitual name vs. literal name ?
STUMPED: Any ideas?
Filedownload.asmx contains:
<%@ WebService Language="VB" CodeBehind="~\App_Code\FileDownload.vb" Class="FileDownload" %>
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.IO
<webservice(namespace:="http: tempuri.org="" ")=""> _
<webservicebinding(conformsto:=wsiprofiles.basicprofile1_1)> _
<global.microsoft.visualbasic.compilerservices.designergenerated()> _
Public Class FileDownload
Inherits System.Web.Services.WebService
<webmethod()> _
Public Function DownloadTheFile() As String
Return "Hello FROM File Download THE File"
End Function
End Class
|
|
|
|
|
How did you host your web service on Hosting Server? Did you create virtual Directory in IIS?
|
|
|
|
|
This is on a hosting service's servers so I don't have access other than ftp my files to the httpdocs folder where I made a subfolder FileXfer and there reside my files and App_Code subfolder.
(I tried to call them and got someone that knows nothing other than it does run .net 2.0.5)
I did get on their hosting page and saw how I can change the .net version, but didn't see virtual names. I did create a subdomain FileXfer that points to the FileXfer folder.
I removed a file precompiled.config (or similar) and now referencing it through the subdomain is working.
http://www.mydomainname.com/FileXfer/FileDownload.asmx -- not work.
But accessing it physically with vb code in asmx file: www.mydomainname.com/FileXfer/Filedownload1File.asmx does still work.
Both work through domain:
http://filexfer.mydomainname.com/Filedownload.asmx"
I'm just new to this environment, otherwise a business app programmer. So I'm just not getting the stuff in the right place, the right way.
I think this is working, but I still don't understand why the combination of direct file name access (vs. through subdomain name) AND vb code in codebehind (separate file) does not work together.
modified on Friday, July 17, 2009 3:51 PM
|
|
|
|
|
Lori,
After developing our web sites/Web service what we need to do, just hosted it onto server. And this means we have push it on IIS Server. In IIS, we need to create virtual directory and need to set the properties for Default pages, .NET Framework version, Authentication settings etc. Then only it can accessable properly.
|
|
|
|
|
What could be the possible situations/scenarios when you want to have a dictionary object within dictionary?
Meaning a dictionary object which would take another dictionary as its key.
private Dictionary<Dictionary<string, string>, string> myDictionary = new
Dictionary<Dictionary<string, string>, string> ;
I mean, I'm trying to go through some code and its doing that, I am new to such complicated data structures such as ditionaries....and this doesnt even look like a common way most people use it.
Post people would have a string key and a string value ( or interger or something).
can someone elaborate on this?
Thanks a lot
Tina
|
|
|
|
|
What does this have to do with ASP.NET ? you would use it, if you need it. If you have no clear need, don't do it. Why are you asking ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I'm not sure what you meant...this is all done from a ASP .net page and that's why the questions was published in this section. Please educate me if there's a separate location pertaiing to questions regarding such data structures and their use.
Now my question is that I'm not familiar with Dictionary data structure, so I'm not sure how is stuff functioning in the code that I'm looking at right now written by someone else with no cmments or documentation...
I googled it quite a bit, but no one appear to be using Dictionary in a way that either its key or the value element are another DIctionary object.
Can anyone please share their experience if they've used it or are familiar with it.
Thanks
Tina
|
|
|
|
|
Tina P wrote: this is all done from a ASP .net page and that's why the questions was published in this section
But it's not related to ASP.NET, it's just vanilla C#, it could be in any C# project.
Tina P wrote: Please educate me if there's a separate location pertaiing to questions regarding such data structures and their use
C# forum for general C# questions
Tina P wrote: Now my question is that I'm not familiar with Dictionary data structure, so I'm not sure how is stuff functioning in the code that I'm looking at right now written by someone else with no cmments or documentation...
OK, well, that's another question.
You have a dictionary, and when you look up a key, the value you get back is another dictionary. So, you could use this, for example, to create a grid, look up x first, then y. Of course, you'd usually use a 2D array for that, but the point is, to get to the data you want, you obvously need to look up two values, not one.
It's just a dictionary, twice. You provide two keys to get to the end value.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I will please like someone to give me some help on how to creat an asp.net, Visual Basic forum.
|
|
|
|
|