|
Search For Asp.Net Globlazation Concept for dynamic language change. If you dont know another language then the translator API can create some problem into some words.
Deepak
 Smile a Lots,Its Costs Nothing
|
|
|
|
|
Hello to All Forum members.
I want to use a Tree view with multiple check boxes in Asp.net with c#.
I used "ShowCheckBoxes" properties of tree view to display node, these node are actually modules name of the project.
But I have to add two more checkboxes in each node to giving Edit and Delete Permissions of the modules.
Please visit the Url for more clear of the picture.
http://picasaweb.google.com/lh/photo/yfojhqq0dTeYi9oxRKcRAw?authkey=Gv1sRgCLnG4-v31czmLw&feat=directlink[^]
How can I achieve this ?
Please any one tell me the complete solution.
Thanks in Advance.
Vishnu Narayan Mishra
Software Engineer
|
|
|
|
|
Do like this :
<asp:TreeView ID="myTreeView" runat="server" ImageSet="Arrows" PathSeparator="|"
ShowCheckBoxes="All">
</asp:TreeView>
ShowCheckBoxes="All"
This is what you are looking for.
|
|
|
|
|
Hi
I already told that I did implemented this.
But I have to add two more check boxes.
Please visit the Url (Image) given in my post before giving me the answer.
This will clear you the picture what I exactly want?
Vishnu Narayan Mishra
Software Engineer
modified on Monday, January 4, 2010 7:57 AM
|
|
|
|
|
We incorporate a treeview like this in our Internet Filtering product. What we have done in this case is to use a third party ActiveX control. So you might want to consider searching the web for third party controls, and testing them out for your purpose. It's easier than trying to code it all yourself.
Web Filtering Guy
|
|
|
|
|
a.aspx
function btnLogin_onclick() {
var NumRandom = document.getElementById("lblRandom").value;
if (compare()) {
var str = '<%=WebEncrypt("' + NumRandom + '")%>';
document.write(str);
}
a.aspx.cs
public string WebEncrypt(string Text)
{
return Text;
}
it returns '+NumRandom+',Whyyyyyyyyyyyyy.....
|
|
|
|
|
Yaa... I think you dont know the basics of Web programming right.
Let me explain you.
In case of Web Applications, if you write server tag like <% %> it will get replaced in response.
Therefore, anything in the server tag is evaluated when the actual page is rendered.
But as javascript runs in the browser, it will run after all the page processing is done and the response in the browser.
You cant call a server method this way using server tag. You need to use AJAX to call server methods. You might use ICallbackEventHandler or PageMethods or your custom AJAX to do this job. But seriously, you cant pass value of javascript variable this way..
|
|
|
|
|
thanks
|
|
|
|
|
hi all,
when i am giving a mail-id in text box it has to check that the mail id is valid or not. Ex:if i give basha@gmail.com then it have to check the mail id is valid in gmail or not.
Thanks & Regards,
S.Inayat Basha.
|
|
|
|
|
Hi there,
Just use a regular expression validator control with the appropriate regex.
\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)* should do the trick.
Cheers
JimBob SquarePants
*******************************************************************
"He took everything personally, including our royalties!"
David St.Hubbins, Spinal Tap about Ian Faith, their ex-manager
*******************************************************************
|
|
|
|
|
I think he wants to validate the existence of an email id in gmail. In this case even though the email format is valid but the check can still fail if it does not actually exists under gmail.
|
|
|
|
|
Not very sure but you can check the google APIs for validating an email account. This is only way it can be done.
|
|
|
|
|
Did you tried searching google ?
In the first search itself, I found what you needed.
Even you would have been able to see this[^], if you had tried.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
Try something like this ...
1) have the user enter an email account
2) your application generates a link with a random number and sends it to the person for them to click on
3) when the user clicks on this link it will validate that the email account is valid.
4) put an expiration date for the link so that if they don't respond in 3 days the link becomes invalid.
Just a thought.
david
|
|
|
|
|
Hi, you can use this class:
class email_validation_class
{
//var $email_regular_expression="^([a-z0-9_] |\\- |\\.)+@(([a-z0-9_] |\\-)+\\.)+[a-z]{2,4}$";
var $timeout=0;
var $localhost="";
var $localuser="";
Function GetLine($connection)
{
for($line="";;)
{
if(feof($connection))
return(0);
$line.=fgets($connection,100);
$length=strlen($line);
if($length>=2 && substr($line,$length-2,2)=="\r\n")
return(substr($line,0,$length-2));
}
}
Function PutLine($connection,$line)
{
return(fputs($connection,"$line\r\n"));
}
Function ValidateEmailAddress($email)
{
//return(eregi($this->email_regular_expression,$email)!=0);
return(eregi("^([a-z0-9_] |\\- |\\.)+@(([a-z0-9_] |\\-)+\\.)+[a-z]{2,4}$",$email)!=0);
}
Function ValidateEmailHost($email,$hosts=0)
{
if(!$this->ValidateEmailAddress($email))
return(0);
$user=strtok($email,"@");
$domain=strtok("");
if(GetMXRR($domain,&$hosts,&$weights))
{
$mxhosts=array();
for($host=0;$host<count($hosts);$host++)
$mxhosts[$weights[$host]]=$hosts[$host];
KSort($mxhosts);
for(Reset($mxhosts),$host=0;$host<count($mxhosts);Next($mxhosts),$host++)
$hosts[$host]=$mxhosts[Key($mxhosts)];
}
else
{
$hosts=array();
if(strcmp(@gethostbyname($domain),$domain)!=0)
$hosts[]=$domain;
}
return(count($hosts)!=0);
}
Function VerifyResultLines($connection,$code)
{
while(($line=$this->GetLine($connection)))
{
if(!strcmp(strtok($line," "),$code))
return(1);
if(strcmp(strtok($line,"-"),$code))
return(0);
}
return(-1);
}
Function ValidateEmailBox($email)
{
if(!$this->ValidateEmailHost($email,&$hosts))
return(0);
if(!strcmp($localhost=$this->localhost,"") && !strcmp($localhost=getenv("SERVER_NAME"),"") && !strcmp($localhost=getenv("HOST"),""))
$localhost="localhost";
if(!strcmp($localuser=$this->localuser,"") && !strcmp($localuser=getenv("USERNAME"),"") && !strcmp($localuser=getenv("USER"),""))
$localuser="root";
for($host=0;$host<count($hosts);$host++)
{
if(($connection=($this->timeout ? fsockopen($hosts[$host],25,&$errno,&$error,$this->timeout) : fsockopen($hosts[$host],25))))
{
if($this->VerifyResultLines($connection,"220")>0 && $this->PutLine($connection,"HELO $localhost") && $this->VerifyResultLines($connection,"250")>0 && $this->PutLine($connection,"MAIL FROM: <$localuser@$localhost>") && $this->VerifyResultLines($connection,"250")>0 && $this->PutLine($connection,"RCPT TO: <$email>") && ($result=$this->VerifyResultLines($connection,"250"))>=0)
{
fclose($connection);
return($result);
}
fclose($connection);
}
}
return(-1);
}
};
April
Comm100 - Leading Live Chat Software Provider
modified 27-May-14 21:46pm.
|
|
|
|
|
Hi,
actually my requirement is that to create ajax modal pop up dialogue for dynamic controls.
i have already posted regarding the same. now i came with one thought that creating the ajax modal pop up extender from C#..
the aspx code is
<table>
<tr><td>
<asp:Button runat="server" ID="btntext" Text="test"
/>
<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</ajaxToolkit:ToolkitScriptManager>
<ajaxToolkit:ModalPopupExtender ID="MPE" runat="server"
TargetControlID="btntext"
PopupControlID="panel"
BackgroundCssClass="modalBackground"
DropShadow="false"
OkControlID="Ok"
X="200"
Y="200"
CancelControlID="Cancel"
/>
</td></tr>
</table>
this s normal code to create ajax pop up.
and my C# code is( need to open when clicking an link button)
protected void Link_Click(object s, EventArgs e)
{
string str;
LinkButton lbl = s as LinkButton;
str = lbl.CommandName;
//ajax.ToolkitScriptManager ToolkitScriptManager1 = new AjaxControlToolkit.ToolkitScriptManager();
ajax.ModalPopupExtender MPE = new AjaxControlToolkit.ModalPopupExtender();
MPE.TargetControlID = "lbl";
MPE.PopupControlID = "panel";
MPE.BackgroundCssClass = "modalBackground";
MPE.DropShadow = false;
MPE.OkControlID = "Ok";
MPE.X = 200;
MPE.Y = 200;
MPE.CancelControlID = "Cancel";
}
am i going n the correct way?
but its not working though.
y because in aspx if u give the target control id for pop up it wont be visible in the page , when you click it will come.
but here its not possible..
can any one help me how to create modal pop up for dynanic??
or is there anything other than ajax..??
help me
thanks in advance
|
|
|
|
|
Your question is unclear. Few tips to improve the question,
1 - Wrap the code in <pre></pre> tags. This will make the code formatted.
2 - Stop using SMS language. It is hard to read.
3 - If you have multiple questions, number it.
4 - After writing the question, read it few times and ensure people can understand what you are saying.
5 - Use a spell-checker. Decent browsers like Firefox comes with a built-in spell checker.
Hema Bairavan wrote: y because in aspx if u give the target control id for pop up it wont be visible in the page , when you click it will come.
but here its not possible..
Where it is not possible and why it is not possible?
Best wishes,
Navaneeth
|
|
|
|
|
Hi navneeth hope you can get my problem now,
actually my requirement is that to create ajax modal pop up dialogue for dynamic controls.
i have already posted regarding the same. now i came with one thought that creating the ajax modal pop up extender from C#..
the aspx code is
<table>
<tr><td>
<asp:Button runat="server" ID="btntext" Text="test"
/>
<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</ajaxToolkit:ToolkitScriptManager>
<ajaxToolkit:ModalPopupExtender ID="MPE" runat="server"
TargetControlID="btntext"
PopupControlID="panel"
BackgroundCssClass="modalBackground"
DropShadow="false"
OkControlID="Ok"
X="200"
Y="200"
CancelControlID="Cancel"
/>
</td></tr>
</table>
this s normal code to create ajax pop up.
and my C# code is( need to open when clicking an link button)
protected void Link_Click(object s, EventArgs e)
{
string str;
LinkButton lbl = s as LinkButton;
str = lbl.CommandName;
//ajax.ToolkitScriptManager ToolkitScriptManager1 = new AjaxControlToolkit.ToolkitScriptManager();
ajax.ModalPopupExtender MPE = new AjaxControlToolkit.ModalPopupExtender();
MPE.TargetControlID = "lbl";
MPE.PopupControlID = "panel";
MPE.BackgroundCssClass = "modalBackground";
MPE.DropShadow = false;
MPE.OkControlID = "Ok";
MPE.X = 200;
MPE.Y = 200;
MPE.CancelControlID = "Cancel";
}
am i going in the correct way?
but its not working though.
In aspx if u give the Popup control id for pop up the control wont be visible in the page , when you click it will come.
but here i.e while creating ajax pop up from the C# code its parameter TargetControlID and PopupControlID is accepting as string, thus it will take the control dynamically, and the control is visible in the page.But in aspx code if we give the control ID to the PopupControlID , the control wont be visible in the page.
can any one help me how to create modal pop up for dynanic??
or is there anything other than ajax..??
help me
thanks in advance
|
|
|
|
|
have you search this in goolge. if yes then you will get easily.
any way look at link below and read the same you will easily learn it.
http://www.asp.net/AJAX/AjaxControlToolkit/Samples/ModalPopup/ModalPopup.aspx
Regards
Keyur Satyadev
|
|
|
|
|
|
I have built simple asp.net website that retrieve financial data from Yahoo Finance. The data is historical prices for roughly 2000 stock tickers. When running the program, I notice that the speed at which these data get retrieved, processed, and insert (bulk insert) into my database gradually decreases over time. For example, data would be written into the database at 8 stock tickers every 5 seconds, but after 15 minutes, it's like 3 stock tickers every 5 seconds.
Is this because memory was not handled properly (like datasets not disposed at the right time) or some other issues related to ADO.net?
I'd greatly appreciate for any suggestions. Thanks!
|
|
|
|
|
James Shao wrote: Is this because memory was not handled properly (like datasets not disposed at the right time) or some other issues related to ADO.net?
May be. Hard to tell more without knowing more about your code. Few things which you could try,
1 - Ensure calls to Dispose() for types that implements IDisposable . Wrapping the object inside a using block is the way to go.
2 - Profile your methods and see which one is taking long time. For now, start with StopWatch class and get the execution time for the methods.
If you can provide some sample code, probably I could help more.
Best wishes,
Navaneeth
|
|
|
|
|
Thank you Navaneeth, I'll begin by trying Stopwatch and check the location where inefficiency occurs. 
|
|
|
|
|
I am comparatively new to the test driven development and unit testing. I spent last two weeks to learn the concept of these technologies. Following is my understanding about unit testing. Please correct me if I am wrong.
1. Unit test would be an over kill for small asp.net projects.
2. I believe testing how aspx pages rendering is an important fact. As far I know NUnit test is not capable for doing this. I know the free tool NUnitAsp but the development on this project is terminated. I also found some other tools like selenium. How is your opinion about it?
Is it worth to learn NUnit test for asp.net? How about to implement Unit test in small asp.net applications?
Thanks and regards,
Poppy
|
|
|
|
|
First of all, unit testing is not a technology. It's a practice.
popchecker wrote: Unit test would be an over kill for small asp.net projects.
I don't think so. Most of the projects start as small and evolve to a bigger one. In such cases unit testing helps you to catch errors when you move code around and add more code. When the application is small, number of unit tests also will be small. So I don't see anything wrong in having that.
popchecker wrote: I believe testing how aspx pages rendering is an important fact
I am afraid that is not unit testing.
Usually you don't write unit tests for the presentation part. You need to split the things that needs testing from the UI and keep UI very thin. Patterns like MVC and MVP helps you to achieve this kind of design.
popchecker wrote: I know the free tool NUnitAsp but the development on this project is terminated. I also found some other tools like selenium. How is your opinion about it?
I haven't used it so far. But I have heard some good comments about selenium.
popchecker wrote: Is it worth to learn NUnit test for asp.net?
Yes.
Best wishes,
Navaneeth
|
|
|
|