|
Use File.ReadAllBytes() to get a byte array of the file. Like this take two byte arrays represents two files. By checking the array length, you will find which is big one. If both are same length, then loop through each bytes and check with the same location in second array.
Hope you can make it.
|
|
|
|
|
Following is the expression i am using to validate for the numeric expression.
[0-9]+ (in regular expression validator)
if i leave the textbox blank , then the above expression gets failed to validate.I am not getting the error message in this case.
Any idea ?
|
|
|
|
|
In this case you have to handle RequiredFieldValidator not RegularExpression
|
|
|
|
|
Yes Thanks.I think , I need to use both validator altogether.
|
|
|
|
|
iam having a frid view with one visible field and one with hidden fields now i want to compare the hiedden field value with visible field how could possible.
|
|
|
|
|
Hi,
CType(gvMaster.Rows(e.RowIndex).FindControl("HiddenField"), HiddenField).Value = CType(gvMaster.Rows(e.RowIndex).FindControl("textfield"), TextBox).Text
|
|
|
|
|
Hi All,
I develop an application(ASP.NET1.1) in which I want to import data from *.xls file to Sql Server 2000. But there is SQLBulkcopy does not work. Please help me.
Thans & Regards:
Suveen Mohan
modified on Wednesday, January 09, 2008 11:31:13 PM
|
|
|
|
|
Are you sure you want the data from .xls, Basically .xls files define just rendering of xml.
Be more precize paste a sample source file and specify requirement.
|
|
|
|
|
|
I think you probably need to check the name of checkedboxes. AFAIK, if you put the checkbox in GridView, the checkbox name will be like "GridViewName_ControlName_01". so, you will need to check the name in for-loop of checkAll function.
|
|
|
|
|
I check the code by specyfing the checkbox name itself.I attach the javascript code below.Please chk it and reply me.
function SelectAllCheck(chkVal, ValId)
{
var frm = document.forms[0];
if (ValId.indexOf('DeleteRecd') != -1 && chkVal == true)
{
var AllAreSelected = true;
for (i=0; i<frm.length; i++)
{
if (frm.elements[i].id.indexOf('DeleteRecd') != -1 && frm.elements[i].checked == false)
{
AllAreSelected = false;
break;
}
}
if(AllAreSelected == true)
{
for (j=0; j<frm.length; j++)
{
if (frm.elements[j].id.indexOf ('CheckAll') != -1)
{
frm.elements[j].checked = true;
break;
}
}
}
}
else
{
for (i=0; i<frm.length; i++)
{
if (ValId.indexOf ('CheckAll') != -1)
{
if(chkVal == true)
{
frm.elements[i].checked = true;
}
else
{
frm.elements[i].checked = false;
}
}
else if (ValId.indexOf('DeleteRecd') != -1 && frm.elements[i].checked == false)
{
for (j=0; j<frm.length; j++)
{
if (frm.elements[j].id.indexOf ('CheckAll') != -1)
{
frm.elements[j].checked = false;
break;
}
}
}
}
}
}
|
|
|
|
|
|
Your code looks totally inefficient and loops unnecessarily. You need to consider a re-design. Problem here is you are taking all the checkboxes in the form. But you need to take only checkboxes contained in the gridview. For doing that put a public variable which holds total gridview count. When checkbox is checked, get this value in your JS function. Start a loop till the count. Create check box id's inside this loop and find the check box. This will be much efficient.
|
|
|
|
|
|
SreejithAchutan wrote: Please send the code for that .What ever changes need in the code plz change it
I have given you all possible ideas for doing that. Why don't you write code yourself ? I have no time to write code, Sorry.
|
|
|
|
|
Im trying to use the gridview and i keep getting the following error:
Control 'GridView1' of type 'GridView' must be placed inside a form tag with runat=server, even though i do have a runat server tag:
<asp:gridview id="GridView1" runat="server">
br mode="hold" />I am a novice to asp.net, its probably sometrhing very simple . Can anyone help?? Many thanks.
modified on Wednesday, January 09, 2008 7:28:28 PM
|
|
|
|
|
Is your Gridview inside a form tag?
|
|
|
|
|
No it is not within a form tag. Where do i put the form tag??
|
|
|
|
|
put the form tag within body tag. put the gridview within form tag.
|
|
|
|
|
Hi,
Whats is the default width, height of the ASP.Net textbox. In my form I have textboxes and one custom control which is using writer.AddAttribute(HtmlTextWriterAttribute.Type, "text"); -> for this I need to set the height, width same as asp.net textbox to do the formatting.
I am setting like this in the custom control
writer.AddStyleAttribute(HtmlTextWriterStyle.Width, "138px"); here I need the asp.net textbox width? How we get the default width?
Thanks
|
|
|
|
|
Okay, here is the issue I am having:
I have created a web app that puts applicant's information into a database. From there the user can do a search for particular users. There is also a function to create a report based on a series of sql queries. The report is created by calling an existing word document, which is in a .doc format, and then replaces bookmarks in the file with the results of the queries. Once that is done, the vb code will then save the report under a new file name and then have the user either open or save the new file on their computer.
Here is where the problem lies. For the past month when I got this originally working, I was able to put my web app into the IIS on my computer so I could test it out on the internal network without migrating it to it's permanent home. It was all working fine until yesterday, when I rebooted my machine. Now, when I call the code to create the document, my browser's progress bar will stop at about 25% of the way and nothing will happen. I can see that the aspnet worker process is running and has called winword.exe and the sql process, but nothing will happen.
When I go to debug the app, here is the line that it is stopping on:
<br />
Dim doc As Microsoft.Office.Interop.Word.Document = wordApp.Documents.Open(filename, confirmConversions, isreadOnly, addToRecentFiles, _<br />
passwordDoc, passwordTemplate, revert, writepwdoc, writepwTemplate, format, encoding, _<br />
visible, openRepair, docDirection, notEncoding, xmlTransform)
The funny thing is that I can run the code just fine when I go back to my original debug folder on my machine. What am I doing wrong here?
|
|
|
|
|
<br />
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
Bitmap hojaBmp = new Bitmap(760, 1000, PixelFormat.Format32bppArgb);<br />
Graphics gr = Graphics.FromImage(hojaBmp);<br />
gr.FillRectangle(Brushes.White, 0, 0, 760, 1000);<br />
<br />
Font fnttxt = new Font("Courier New", 10, FontStyle.Bold);<br />
<br />
gr.DrawString("Texto", fnttxt, Brushes.Black, 50, 33);<br />
<br />
hojaBmp.Save(Server.MapPath("65656.jpg"));<br />
hojaBmp.Dispose();<br />
<br />
printOut = printOut + "<img style="\"width:100%\"" src="\"65656.jpg\"/">";<br />
<br />
}</img>
<%
Response.Write(printOut);
Response.Flush();
%>
window.print();
|
|
|
|
|
I want to maintain state of web form (i.e; not to lose any user input values of textboxes,checkboxes etc) without using session,querystring etc.
The reason i don't wanna use the above mentioned method is that i've got so many pages and it would be a tedious task to do.
Hope to have a better solution for this.
|
|
|
|
|
You can enable the ViewState
------------------------------------------------------------
"The only true wisdom is in knowing you know nothing." --Socrates
|
|
|
|
|
well the thing is across web pages i wanna do that
|
|
|
|