|
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
|
|
|
|
|
Thanks for reply. Let me ask one more question. How can I test my presentation part? Can you please suggest me a method?
Thanks and regards,
Poppy
|
|
|
|
|
You have to use UI testing frameworks like QTP.
Best wishes,
Navaneeth
|
|
|
|
|
Thanks Navaneeth
I am going to implement NUnit test in my next project. Sure I will come back with few more doubts.
|
|
|
|
|
Hi peoples,
i like to use the ajax modal popup window for dynamically genarated link button.
my 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>
<asp:repeater id="rptProducts" runat="server" OnItemDataBound="RepeaterItemEventHandler">
<ItemTemplate>
<table cellpadding="5" cellspacing="0">
<tr>
<tr><td><asp:LinkButton runat="server" ID="i" OnClick="Link_Click" CommandName=<%#Eval("fao_addsnumber")%> > <%#Eval("fao_subcategory")%> </asp:LinkButton></td></tr>
<tr><td align="left" ><asp:Label runat="server" ID="lblitem"></asp:Label></td></tr>
</table>
</ItemTemplate>
</asp:repeater>
in the above code the target id is button and is working fine.
but my req is with some conditions i will dynamically generate the link labels from , and that will be in the repeaters.
in that link label i want to give this modal dialogue to open.
how to do that, please help.. thanks in advance
|
|
|
|
|
Hi all,
the stored procedure is working fine if i run from the query editor, but its not when from asp application (C#)
actually
my procedure is
create proc test
@text varchar(50)
select * from table where Column like @text
if i execute from query editor
exec proc '%text%'
its working fine for me
but from asp C#
SqlDataReader dr;
SQLCommand Cmd;
Cmd.Parameters.Add("@text","%text%")
dr = Cmd.ExecuteReader();
its not working for me, its giving wrong result.
any idea can any one help me?
|
|
|
|
|
Have a look to thislink.It will help you
Cheers!!
Brij
|
|
|
|
|
mr brij,
what you gave is how to execute a procedure from .net.
but my question is not that, the behavior of the varchar(i/p parameter) while sending from the .net.
|
|
|
|
|
For sending the parameter to SP,you need to keep in mind very first, that the parameter name should be same in c# as in sp.
For details how to pass to parameter to a sp have a look
One more thing you are passing special characters from C#.It might be creating problem.Just for validation of your code,make a sample POC that doesn't take special characters.
You can also append special characters in SP itself according to your need.
Please let me know when your problem gets resolved.
Cheers!!
Brij
|
|
|
|
|
You haven't set CommandType property of SqlCommand to CommandType.StoredProcedure .
Best wishes,
Navaneeth
|
|
|
|
|
thanks for your reply navneeth,
and i have give the same
..
my code is
SqlCommand Cmd = new SqlCommand();
_Dal.CreateCommand(ref Cmd, "dbo.fao_getpagedproducts");
Cmd.CommandType = CommandType.StoredProcedure;
SqlDataReader dr;
Cmd.Parameters.Add("@PageSize", SqlDbType.Int, 4).Value = pager1.PageSize;
Cmd.Parameters.Add("@CurrentPage", SqlDbType.Int, 4).Value = pager1.CurrentIndex;
Cmd.Parameters.Add("@Text", SqlDbType.Char, 50).Value = "%"+txtSearch.Text.Trim()+"%";
Cmd.Parameters.Add("@DDLCategory", SqlDbType.Int, 1).Value = Convert.ToInt32(RBCategory.SelectedValue.ToString().Trim()
== "" || RBCategory.SelectedValue.ToString().Trim() == "9" ? "0" : RBCategory.SelectedValue.ToString().Trim());
Cmd.Parameters.Add("@ItemCount", SqlDbType.Int).Direction = ParameterDirection.Output;
dr = Cmd.ExecuteReader();
rptProducts.DataSource = dr;
rptProducts.DataBind();
dr.Close();
here txtSearch is a text box for which i have search
and my procedure is
create PROCEDURE dbo.fao_getpagedproducts(
@Text INT,
)
select * from table where column like @Text
i have shown my simple code
here my text is not working fine..
can you get me wat i m asking for?
|
|
|
|
|
Hema Bairavan wrote: Cmd.Parameters.Add("@Text", SqlDbType.Char, 50).Value = "%"+txtSearch.Text.Trim()+"%";
Hema Bairavan wrote: @Text INT,
I guess the datatype is wrong. Procedure expects and INT and you are passing Char . Try changing the parameter type to Varchar in both places.
Best wishes,
Navaneeth
|
|
|
|
|
extremly sorry navneeth that was char though.
while editing here i missed the text as INT.
i gave that as char only,
and previously i gave varchar in procedure, its not working
when i changed at both the places it works fine
thanks for your support.
and i have also posted new post regarding the ajax controls. if u have time help me though.......
happy new year
|
|
|
|
|
Hi All
I want to add a menu somewhat like that of codeproject(see above the green horizontal div)
Home Articles Quick Answers etc
I was using asp:menu
<asp:menu id="NavigationMenu"
staticdisplaylevels="2"
staticsubmenuindent="10"
orientation="Vertical"
target="_blank"
runat="server" >
<DynamicMenuItemStyle BackColor="Aqua" Font-Bold="true" />
<dynamichoverstyle backcolor="Green"
forecolor="Black"/>
<items>
<asp:menuitem navigateurl="Home.aspx"
text="Home"
tooltip="Home">
<asp:menuitem navigateurl="Music.aspx"
text="Music"
tooltip="Music">
<asp:menuitem navigateurl="Classical.aspx"
text="Classical"
tooltip="Classical"/>
<asp:menuitem navigateurl="Rock.aspx"
text="Rock"
tooltip="Rock"/>
<asp:menuitem navigateurl="Jazz.aspx"
text="Jazz"
tooltip="Jazz"/>
</asp:menuitem>
<asp:menuitem navigateurl="Movies.aspx"
text="Movies"
tooltip="Movies">
<asp:menuitem navigateurl="Action.aspx"
text="Action"
tooltip="Action"/>
<asp:menuitem navigateurl="Drama.aspx"
text="Drama"
tooltip="Drama"/>
<asp:menuitem navigateurl="Musical.aspx"
text="Musical"
tooltip="Musical"/>
</asp:menuitem>
</asp:menuitem>
</items>
</asp:menu>
But I have seen that if I disable javascript on my browser asp:menu doesnot work.
However codeproject menu works even after disabling the javascript.
Please guide which control is the codeproject using for menu.I want to use the same
Thanks
Regards
Sandeep
|
|
|
|
|
I will suggest you to go for CSS Friendly Menu Adapter. That will resolve your issue.
http://www.asp.net/CssAdapters/[^]
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Abhijit thanks for your answer
Does the menu on the codeproject site is implemented in the same way?
After disabling the javascript would cssadapters will work?
The codeproject menu works even after disabling javascript on the browser.
Thanks
Regards
Sandeep
|
|
|
|
|
simple CSS fixes will do this..
Say in codeproject the Menu structure is like this :
<ul class="nav" >
<li ><a href="#">Home</a></li>
<ul style="display:none;">
<li ><a href="#">ASP.NET</a></li></ul>
</ul>
Now on
#nav a:hover >ul
{
}
You can apply these sort of simple CSS to show / hide menu items which will not be dependent on Javascript as with Codeproject.
|
|
|
|