|
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.
|
|
|
|
|
to store into session:
Session["someID"]="Text To Store";
to retrive :
string someString=Session["someID"].ToString();
|
|
|
|
|
No.U dnt need to use it.Because sessions willbe created in web server so whenever you want to access it from any page you can simply access it by using session["sessionid"] collection object....Thank you!
|
|
|
|
|
So, this is probably something I should know how to do anyway but don't... sadly.
I would like to take a project I found here, specifically: http://www.codeproject.com/Articles/460142/ASP-NET-Multiple-File-Upload-With-Drag-Drop-and-Pr and turn it into a control that I can use on an existing website (after changing the save directory and such of course) in the same way I would drop in, say, CKEditor... drop the DLL's in the Bin directory, register it on the page and then lob in a little, <mfu:mfuupload id="somesuch" runat="server"> magic.
So, how would I go about doing that?
For the record, I'm not as lame as this question implies, there're just giant holes in an otherwise brilliant mind.
modified 18-Sep-12 19:48pm.
|
|
|
|
|
|
Hi,
Can anybody help me with requirement. i have a requirement that an .aspx page will contain a static text box and a static button(GENERATE). user will enter number in the textbox say four(4) and click the GENERATE Button,then 4(four) dropdownlist and a button(ADD) will be dynamically created. The dropdown list will contain data like first(1) dropdown will contain value 1,2,3,4...10 and second dropdown will contain 10,11,12....20 and so on. On Clicking the dynamically created ADD button the values of the dynamic dropdowns will be summed and shown in another label that will be dynamically created of the dynamically created ADD button click event.
Thanking you. Any kind Of Help is earnestly solicited.
|
|
|
|
|
Steps:
1. Define a GENERATE Button click handler X
2. In X, get the number provided in Textbox (say y)
3. Define a counter(say z). Set it to one.
4. Code a for loop from zero to y-1 (loop runs y times)
5. Create a dropdownlist inside the loop using new.
- Provide ID
- Define a datasource - a list
- Populate list with fixed 10 numbers starting from z. for first loop z goes from 1 to 10, next 11-20...
- Bind the datasource to dropdonw
- Add the dropdown to the defined panel/placeholder in UI
6. Once for loop ends, create a button (A), define click event and add that too the defined panel/placeholder in UI.
7. for click event of A, do your manipulations as per need.
Try!
|
|
|
|
|
I am trying to build a total image from a series of png files chosen by the user by checkboxes. This will be displayed on a website. I have already successfully done this by using CSS and z indexing for layer heights but now it has been suggested to me to use the bitstream method to compile and display the final picture.
Can anyone tell me which of these methods (css or bitstream) is the most efficient for speed and server resources on the web?
Thanks in advance
|
|
|
|
|
If you are using CSS and creating the image on the client then there is no impact on the server other than, probably, getting the images to use.
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
hi ,
, my website was created with .Net 3.5 , i cant install .Net 3.5 on the server, can i run my website with .net4 on IIS ??
|
|
|
|
|
You can run your website in both .Net framework 3.5 and 4.0. While opening the website in .Net 4.0, you'll be ask to update your website. Depends upon you, whether you want to update the website or continue using 3.5 only.
|
|
|
|