|
A simple hack is to put a listbox to the left of the textbox and display line numbers as items in the list box. Then you change the borders of the list box and the text box to make them appear as a single control.
For more advanced uses, you need to create your own custom control like ICSharpCode.TextEditor[^] or AvalonEdit[^]
|
|
|
|
|
There is no direct way or a control that does what you seek. You have to develop your own control for such behavior.
|
|
|
|
|
|
Hi,
I am new to WCF, but I like to have them in my production project instead of web services because of greater flexibiltity of WCF.
I have this scenario: One WCF that serve 9 client of the same application (on 9 different servers). The WCF build a Barcode ad return a PNG image.
I think that the better configuration is Single instance / Multiple concurrency. I also use Async methods to reduce latency.
Note that the client instance is a singleton shared between users on the same server, maybe a check on channel status is necessary?
Actually I am a little confused reading articles on WCF: some don't talk about Channel state, factory etc. Others articles show checks on channel state and Channel factory everywhere... What I have to do to make this thing work?
Thank you!
NOTE: using framework 3.5
|
|
|
|
|
It is a little unclear as to what the setup is.
Are there 9 servers and 9 clients (each running their own instance of WCF)?
Or is there only 1 WCF service and 9 different clients accessing that same instance of the WCF service?
If you are just having the WCF service build an image and do no server side logic, I would remove the WCF service all together.
If there is server side logic, then 1 instance of the WCF service is usually ideal since you only need to update the application in 1 place and the clients all get the functionality (unless the clients require an update as well).
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Thank you for your reply.
My configuration is your second one: 1 WCF service for 9 Clients.
There is not much server logic in the WCF, but since is a generic Barcode generator placed in a context where a lot of applications could use it, I think that is a good choice to have it in WCF instead of inside the main project. I will do some benchmatks to understand better if it is an issue or not.
However, my question regards how to use (and consume) wcf: I have to declare simply:
public static BarcodeServiceClient BarcodeServiceClient
{
get
{
if (_barcodeServiceClient == null)
{
_barcodeServiceClient = new BarcodeServiceClient();
}
return _barcodeServiceClient;
}
}
OR I have to manage channels?
|
|
|
|
|
You shouldn't have to manage channels. You only need to if you are trying to use features of channels.
Look up some basic WCF articles here on CodeProject. You are basically just trying to execute a remote method. That is very straight forward with WCF.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
|
Hey guys,i am having trouble with my application in terms of clearing textboxes when i change my tabs.i have one tabcontainer with 3 tabs namely "Create" "update" "Delete" in my tabcontainer1 .the code i tried:
protected void tabContainer1_ActiveTabChanged(object sender, EventArgs e)
{
if (tabContainer1.ActiveTabIndex == 0)
{
txtCompanyname.text="";
}
am i doing something wrong?
also 1 more problem i have is that my gridview is stretching out of my page,any way around this guys?
Thanks Smile |
|
|
|
|
|
Your event is probably firing twice, the first one clears the textbox, and the second populates the textbox in onload
You have to seperate code that runs on postback, from code that runs on onload, using
page.ispostback
So when a page loads, if not page.ispostback
When a page postback to the server, if page.ispostback
|
|
|
|
|
Hello
yes i think it was firing twice and it clears ,however on that page under the tab i have a place to add info which in turn saves info to my database and its not saving the information entered in the textbox as its clearing before/or when i click "save"(My button).
i coded the textboxes to clear only when the tabs are changed.please help.
Thanks you guys
|
|
|
|
|
HimalR8 wrote: yes i think it was firing twice
I know it was firing twice, that's what it does by design in asp.net.
When using the form tag on your webform, and ....
When you click on the tab, a postback is generated to the server, so the page loads again and posts back textboxe values and such to the server, the server responds, and sends back the page, in which the page loads again, and I think the the event fires again.
So on Page.load or the onLoad overide
If you don't check for the postback state, new data will always load over and over and over, wiping out the values set by the user
protected sub page_load
If !(page.ispostback) {
'Load Data now
}
}
And on events such as button clicks,
For the tab, I used the select or swtich statement, so it can be expanded for other values
protected void tabContainer1_ActiveTabChanged(object sender, EventArgs e) {
if (page.ispostback) {
switch (tabContainer1.ActiveTabIndex) {
case 0:
txtCompanyname.text="";
break;
}
}
}
|
|
|
|
|
I have been working with the MVVM pattern and WPF for some time now and I have a pretty good grasp of it (I think). I am working on an ASP.NET MVC3 project right now and I am really struggling with the ViewModel. Currently I have a datagrid (Actually a telerik grid) that I want to display data in. The data is defect data, and I want to display it's corresponding category and some other stuff.
The data looks like this:
Defect
id | int
categoryId | int
name | varchar
Category
id | int
Brevity. So I want the index to display just the name of defect and the name of the category but when I edit the data in the grid I want to display a dropdown list of all available categories.
What should a VM look like for this? Truthfully I am inundated with so many concepts for web programming that I am really wilting. Unit of Work, Generic Repository, MVC, ViewModel, AutoMapper. I am struggling to find an inclusive example. So many view models that are displayed do not accommodate my pattern needs or they only go with a single table.
Cheers, --EA
|
|
|
|
|
Whatever data that is required for the View keep it in ViewModel. Use auto mapper to convert Core DataModel to ViewModel and Vice versa.
- Regards - J O N
|
|
|
|
|
Hey guys, I'm new to Jquery and I'm trying to use <pre>jCapSlide</pre> in a datalist,
<pre lang="HTML">
<asp:DataList ID="DataListList" runat="server" DataSourceID="ObjectDataSourceList"
RepeatColumns="5" CellPadding="5" CellSpacing="5"
OnItemDataBound="DataListList_ItemDataBound">
<ItemTemplate>
<div id="capslide_img_cont" class="ic_container">
<asp:Image ImageUrl='<%#Eval("Images.Image.Virtual_FileName") %>' ID="MainImage"
CssClass="NewsImage1" runat="server" />
<div class="overlay" style="display: none;">
</div>
<div class="ic_caption">
<p class="ic_category">
'<%# Eval("Category.cName")%>'</p>
<h3>
'<%# Eval("pTitle") %>'</h3>
<p class="ic_text">
'<%# Eval("pTitle") %>'
</p>
</div>
</div>
</ItemTemplate>
</asp:DataList>
</pre>
with this Function
<pre lang="Javascript">
<script type="text/javascript">
$(function () {
$("#capslide_img_cont").capslide({
caption_color: 'white',
caption_bgcolor: 'black',
overlay_bgcolor: 'black',
border: '',
showcaption: false
});
});
</script>
</pre>
There are 3 records, this applies on the first one but not the other two,
I think the problem is repeated <pre>id="capslide_img_cont"</pre> but can't seem to fix it.
can you help me out ?
It's deeply appreciated
|
|
|
|
|
Instead of using Div id you can use Class to apply your jquery like,
$(".ic_container").capslide({.....
This may work for you.
Thanks
-Amit Gajjar (MinterProject)
|
|
|
|
|
I have dropdownlist in my gridView header which I populate on RowDataBound event.
When I am trying to add DropDownList selectedIndexChange Event in code DropDownList is not in a lits. How do I add event handler event for dropdownlist in code?
Private Sub gvMarketingPlans_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gvMarketingPlans.RowDataBound
If e.Row.RowType = DataControlRowType.Header Then
Dim ddlProducts As DropDownList = DirectCast(e.Row.Cells(1).FindControl("ddlProduct"), DropDownList)
ddlProducts.Items.Clear()
With ddlProducts
.DataSource = DataSource
.DataTextField = "Description"
.DataValueField = "ProductCode"
.DataBind()
.Items.Insert(0, New ListItem("< All >", ""))
End With
End If
End Sub
|
|
|
|
|
Based on the code, it looks like a dropdownlist does exists from before. In the RowDataBound event you are trying to populate data in that pre-existing dropdown. Since, it pre-exists, you can define a selected change index for it.
In case you want to define it at runtime in RowDataBound, then you need to add this:
AddHandler ddlFilter.SelectedIndexChanged, AddressOf Me.ddl2_SelectedIndexChanged
ddlFilter.AutoPostBack = true
Private Sub ddlFilter_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)
End Sub
|
|
|
|
|
|
This is a forum where people post their issues in form of specific question and others try to help in resolving it.
Based on what you have posted, surely it is not a question. I did not clicked the link as it looked malicious.
Please don't post information messages in this forum. If you have specific question, you are most welcome.
In case you want to share anything with others (some tutorial stuff), please post the content here at CP as a Tip/Article[^] and it will be published post approval.
|
|
|
|
|
OP's post is spam and I have flagged both it and the OP account as such.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Thanks Richard. Since you are sure that it's a spam post and a spam account, I will go by your word and mark them so.
|
|
|
|
|
Hi all I am trying learn how to create and access session variables inside and out side of pageload. I've found that I can create a session variable inside of the pageload method like the following:
int myID = 0;
Session["UserID"] = RetrievedID;
Then I can access the session variable in the pageload method of another page like the following:
int myID = (int)Session["UserID"];
Some questions I have are do I need to use Response.Redirect() method to successfully send session variables to another page, and how do I create and access session variables outside of the pageload method. Thanks in advance.
modified 19-Sep-12 2:35am.
|
|
|
|
|
ASPnoob wrote: do I need to use Response.Redirect() method to successfully send session variables to another page
No
ASPnoob wrote: how do I create and access session variables outside of the pageload method.
similarly as you did now.
Now, overall, you need to understand the concept of Session. First and foremost, it is not page level, it is across the application per user level. For a given user, a session can be created in any page and accessed in any page.
Read about it in much more detail, here:
MSDN: ASP.NET Session State Overview[^]
Exploring Session in ASP.NET[^]
|
|
|
|
|
Session variables are stored on the web server, and are available to that pacticular sessionID number for every page.
|
|
|
|