|
You should also be able to use your custom controls within a gridview template column.
|
|
|
|
|
Thanks Sherin and Paddy
That was my idea initially but I have complete websites and I cannot allow myself to make such interventions. I came up with a solution that works on IE7 (I know it does not work under Firefox, haven't tested other browsers but I strongly believe it does not work there either). I'm just adding the following code at the end of each webpage and it seems to do it...
<%-- add the following code at the end of each webpage, just before the </html> --%>
<script type="text/javascript">
debugger;
function al()
{
var ae =document.activeElement;
if(ae.type=='text') {
ae.value=ae.value.replace('[','ë').replace(']','ç');
}
if(ae.type=='textarea') {
ae.innerText=ae.innerText.replace('[','ë').replace(']','ç');
}
}
var inputs=document.getElementsByTagName("input"); for(var i=0;i<inputs.length;i++)
{
if(inputs[i].type=='text') {
inputs[i].setAttribute('onkeyup',al); }
}
var inputs=document.getElementsByTagName("textarea"); for(var i=0;i<inputs.length;i++)
{
{
inputs[i].setAttribute('onkeyup',al); }
}
</script>
|
|
|
|
|
Hi Frds,
I have a page with datagrid which dispaly Empno,Ename from database and 2 Textboxes .Datagrid contains linkbutton rows when i click a row in daragrid then row value should display in TextBoxes.I've done in
.Net 1.1 version.
Now I wantto do same in 2.0 version but here i am getting problem with rowcommandEvent.
in 1.1 I used this code in ItemCommand :
Dim lnkNoObj As LinkButton = CType(e.Item.FindControl("lnksno"), LinkButton)
Dim lnkNameObj As LinkButton = CType(e.Item.FindControl("lnkname"), LinkButton)
TextBox1.Text = lnkNoObj.Text
TextBox2.Text = lnkNameObj.Text
Same thing when I use in 2.0 i am getting error at item pls tell me what I have to do ..?
|
|
|
|
|
hi
What error you are getting
To succeed, we must first believe that we can.
Sherin Iranimose
|
|
|
|
|
Hi All.
In a web page, which is for entering and saving data.
After saving user redirects to a new page. but User can move Back(using Back button of BROWSER) to that page and can edit and Re save it. So what is the method to prevent user to see old pages or how can we prevent user to save it again.
Second problem is that when page is too long then I don't want my Menu and Header to scroll above the page while using scroll bars.
How is possible to to make it visible while scrolling.
ANy IDEA
Thanks
Bajrang Singh
Using .net 2.0 (VS2005)
|
|
|
|
|
i want to import .cs file
<%@ Import Namespace="~/App_Code/listdat.cs"%>
but it gives error
Compiler Error Message: CS1001: Identifier expected
how to handle that?
thank you
vijaya
|
|
|
|
|
Hi ...
I think u have to give the namespace in import directive . but u gave .cs file ...
think Thats y ur getting that error ...
the syntax for imports directive is
<%@ Import Namespace="System.Diagnostics"%>
<%@ Import Namespace="System.Net" %>
<%@ Import Namespace="Grocery" %>
like this
Iam new to dotnet ...
If iam wrong plz dont mind ...
naresh.s.s
|
|
|
|
|
i want to call functions, that is written in .cs file
in javascript in the aspx page.
function Button1_onclick() {
var mystring;
var mylist = new listdata();
MYLIST.SSQL="SELECT COMPCD, COMPNM, CORPADD,CORPCITY FROM COMPANY";
MYSTRING = MYLIST.PutTOString();
DOCUMENT.WRITE(MYSTRING);
}
vijaya
|
|
|
|
|
here now ive already developed application
my work is to make changes in that application and also merge new modules in that application ...
ive already written functions in my Appllication code now iam doing is that
juz calling that function by giving the namespace at the top of my .cs file thats all...
am not importing the code into .aspx page ,
My application name is ESS ...
Iam using that namespace in my application like giving it in the top of my applicaiotn and am directly calling that function name thats all....
i think u tooo knw this ...
naresh.s.s.
|
|
|
|
|
I think that you can't directly call a server side (c#) function from your client side (javascript) without using some kind of AJAXy style call back.
|
|
|
|
|
Hi
In an application i have a browse button on clicling which i am getting window to choose a file, now i want the code to upload the resume . I got a idea that i need to create a folder in my application where the file wil get saved,
I am using VB as language can any one help me
Regards
Prakash Mishra(Banglore,India)
|
|
|
|
|
hi ..
sss
1st drag a fileuplode control .
and also create a folder wer do u want to save that file (resume)
actually i developed it in C# , plz adjust vth that ..
give this name space : System.IO
Source :
{
string filePath = null;
string path = null;
string fullpath = null;
filePath = "C:/Resumes";
path = filePath;
if (FileUpload1.HasFile)
{
if (Directory.Exists(path))
{
if (File.Exists(path + "/" + FileUpload1.FileName))
{
File.Delete(path + "/" + FileUpload1.FileName);
}
FileUpload1.SaveAs(path + "/" + FileUpload1.FileName);
}
else
{
Directory.CreateDirectory(path);
if (File.Exists(path + "/" + FileUpload1.FileName))
{
File.Delete(path + "/" + FileUpload1.FileName);
}
FileUpload1.SaveAs(path + "/" + FileUpload1.FileName);
}
fullpath = path + "/" + FileUpload1.FileName;
InsertIntoDataBase(fullpath);
Response.Write("File successfully uploaded...");
}
else
{
fullpath = "null";
InsertIntoDataBase(fullpath);
Response.Write("You have to select a file to upload");
}
----------------------\
and u have to give the insert query to load ur file into database ...
i think its useful for u ...
Bye ,
naresh.s.s.
|
|
|
|
|
Thanks
Friend i need a help
what u told is to save the file into the database. but i need to save it in the project folder. i dont to save the file in the database.
Hope u got my point
Prakash Mishra(Banglore,India)
|
|
|
|
|
Ya.......
we are only saving the path of that file in database thats all ....
Juz check out the code wat ive written once , there is a folder like "c:Resumes"..
to that folder we r going to load the file (resume )...
U juz create a new folder in ur PC and give that folder name there thats all...
wen u click on browse u will get the upload window , u can upload the file and it will be saved in ur target folder [ mine is "resume" , u can create ur own ]
I think u got the point rite ?
Any queries plz ask me...
naresh.s.s
|
|
|
|
|
Hi i want to check the given date is sunday or not like...,
Suppose if its sunday it want to execute some conditions
otherwise it want to do some other condition...,
how to do that one?
Plz help me....,
example:
i have 4 textbox each have some values...,
If the given date will be sunday it want to add textbox 2 & 3 and store it in textbox 1
else,if its weekday then it want to add textbox 2 & 4 and store the value in textbox 1
how to do that
plz any one help me...,
-- modified at 4:30 Wednesday 30th May, 2007
Magi
|
|
|
|
|
Hi,
you could try.
<br />
if(DayOfWeek.Sunday.CompareTo(YourDate.DayOfWeek) == 0)<br />
{<br />
...<br />
}<br />
the CompareTo function returns either "-1" = false or "0" = true.
hope this helps
greetings pdluke
|
|
|
|
|
VB Code -.net 2.0
-------
Dim dateobj As Date
dateobj = Now
If( dateobj.DayOfWeek = DayOfWeek.Sunday) Then
textbox1.Text=CInt(textbox2.Text) + CInt(textbox3.Text)
Else
textbox1.Text=CInt(textbox2.Text) + CInt(textbox4.Text)
End If
C# Code-.net 2.0
-------
DateTime dateobj;
dateobj = DateTime.Now;
if( dateobj.DayOfWeek == DayOfWeek.Sunday)
{
textbox1.Text=Convert.ToInt32(textbox2.Text) + Convert.ToInt32(textbox3.Text)
}
else
{
textbox1.Text=Convert.ToInt32(textbox2.Text) + Convert.ToInt32(textbox4.Text)
}
|
|
|
|
|
hi
there is a property called
IsWeekend property
I got some information from net i wil give u the link it is
http://www.ucertify.com/articles/70-305/What-is-the-IsWeekend-property.html
check whether its of any use 4 u or not.
Prakash Mishra(Banglore,India)
|
|
|
|
|
hi
How can i convert the sql table like Employee with fields EmpId , EmpName , EmpSal , etc
into XML data using ASP.Net ?
If anyone kw reply me
thanks in advance
Naresh.s.s
|
|
|
|
|
read the table in to a data set then use the WriteXml method of the
DataSet i.e. ds.WriteXml("ToPath") , check also the WriteXmlSchema method.
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
Hi all
actually on my webpage am displaying some data on the datagrid row wise...as per the project requirement am exposing the data to be editable(displaying in the text boxex) by making use of the itemtempale ...and am keeping one button outside the datagird.and while cliking on the button i am updating the entire datagrid by accepting what ever the data is modified
i.e by calling like
foreach(DataGridItem itm in DataGrid1.Items)
{
string st,st1,st2;
st=((Label)itm.Cells[0].FindControl("lblAccountId")).Text;
st1=((TextBox)itm.Cells[1].FindControl("AccCode")).Text;
st2=((TextBox)itm.Cells[2].FindControl("Descrip")).Text;
dataAdapter=new SqlDataAdapter("update AccountCode set AccountCode='" + st1 + "',Description='" + st2 + "'where AccountId=" + st,con);
dataAdapter.Fill(ds,"contentTable");
}
Know what the problem is...there was somany records like (100+ in the database)..if i did like this,it took a database interaction
to update each row ...i.e,for the single click it will take 100+ times of database interaction...
bcz of performance resion i want to avoid these interactions...i want the updation to be done by making single interaction with the database(i.e i want to handle all the datagrid data and take the updation at single time)......Plz help me out ,,or let me have some articles related to this....
regards
yuva
|
|
|
|
|
u can use command builder
dim da as new sqldatadapter("select * from emp",cn)
dim cmb as new sqlcommandbuilder(da)
dim dt as new datatable
da.fill(dt)
dim dr as datarow()
dim i as int = 0
while i < grid.items.count -1
dr = dt.select("AccountId=" & s1)
if dr.length > 0 then
dr(0).item("AccountCode") = s1
dr(1).item("Description") = s2
end if
i +=1
end while
da.update(dt)
|
|
|
|
|
|
Hi,
Junior Boy wrote: Please help me to convert this code to C# .net.
We can't able to work for you. This forum is only for sharing the knowledge.
Regards,
Jay
|
|
|
|
|
Hi Jay,
Thank you for your replied.
And actually I know in this point
Yes, sure if I know something that people posted.
I would like to reply them too.
To me I don't know about VB .net and I just ask for
someone who can help me. If they don't want to it's ok
but If they do that really appreciate in helping.
Regards,
junior boy
|
|
|
|