|
I am working on onlinecounselling system website.During the admission proceess student who have
9 merit number could not get admission unless the student who have 8 got.This activity is parallell.
mamy student request at the same time how can i achieve synchronization in asp.net? 
|
|
|
|
|
|
Hi
Can anybody tell how to develop a chat application like gtalk for intranet website. How can I send and receive message from database using
MS SQl. Please help me I need the code for that....
or mail me at this hiteshkumar2011@gmail.com
|
|
|
|
|
|
|
Hi
I need to create a dynamically expanding div tag, and I am not too sure how to go about it. Basically, I have a bulleted list control, which will be inserted inside a div tag. The div tag's height is set to about 70px. When more than 5 list items are added to the bulleted list control, I want the div tag's height to expand to show the rest of the items. What I was thinking is when there are more than 5 list items, to have a little linkbutton with the word more, and to click on this button, which will then expand on the div tag.
Does anyone have any ideas as to how to do this?
|
|
|
|
|
Yes you could do a client side button with some javascript.
On clicking the button a function is fired up that gets the element ID of your div box and then increases it's height via CSS. The function would invoke something like:
function myfunction(){
document.getElementById('idofyourdivbox').style.height = "120px";
}
|
|
|
|
|
The only problem that I need to overcome is that whilst my div tag shows 5 list items, what I need to achieve is to expand the div tag just enough to show the other list items. For instance if I need to show 7 list items, I need to expand the div tag height just to show 7 items, and equally to expand the height if there are 12 items.
Therefore, how I can I dynamically increase the height to fit the number of items I want to show without showing too little or too height?
|
|
|
|
|
I see what you're saying. My method would just resize your div box to z set size no matter how many items need to be listed.
I think you need to count the number of items there are in the list when the page loads.
This is something probably best doing server side in whatever language you're using. Then pass the number to client side in a hidden field.
eg <asp:Label runat="server" id="myhiddennumber" visible="false"/>
Use this number to set the height of the div box in javascript.
This function needs to execute after the hidden field has been populated.
eg
function mylistboxsize(){
var getthelist = document.getElementById("myhiddennumber");
// multiply the number in the hidden field to get a height value for the div box. Here we're saying each item is worth 10px
var heightfordiv = getthelist.innerText * 10;
// set the height
document.getElementById('divboxid').style.height = heightfordiv + 'px';
}
The above javascript may need a bit of syntax correction however I think the 'method idea' would work.
|
|
|
|
|
Hi, you can put the items in another div(for example: id="divMoreItems") which is hidden first and which follows the first five items and is contained in your div. When you click the linkbutton, you can set divMoreItems's display="block" or "". When you click the linkbutton again, set divMoreItems's display="none".
modified 27-May-14 4:51am.
|
|
|
|
|
i found this code to upload a file into a sql database using the asp.net fileupload object (or vb)
i found it here
http://forums.asp.net/p/1480079/3451771.aspx
i think it works, but i am a learning noob and have a question...where does my dbase info go in the code?
1. If FleUpload.HasFile Then
2. Dim fileName As String = Server.HtmlEncode(FleUpload.FileName)
3. Dim extension As String = System.IO.Path.GetExtension(fileName)
4. If (extension.ToUpper = ".JPG") Or (extension.ToUpper = ".GIF") Then
5.
6. '**** Resize image section ****
7. Dim image_file As System.Drawing.Image = System.Drawing.Image.FromStream(FleUpload.PostedFile.InputStream)
8. Dim image_height As Integer = image_file.Height
9. Dim image_width As Integer = image_file.Width
10. Dim max_height As Integer = 120
11. Dim max_width As Integer = 160
12.
13.
14. image_height = (image_height * max_width) / image_width
15. image_width = max_width
16.
17. If image_height > max_height Then
18. image_width = (image_width * max_height) / image_height
19. image_height = max_height
20. Else
21. End If
22.
23.
24. Dim bitmap_file As New Bitmap(image_file, image_width, image_height)
25. Dim stream As New System.IO.MemoryStream
26.
27. bitmap_file.Save(stream, System.Drawing.Imaging.ImageFormat.Jpeg)
28. stream.Position = 0
29.
30. Dim data(stream.Length) As Byte
31. stream.Read(data, 0, stream.Length)
32. '**** End resize image section ****
33.
34.
35. Dim myConn As New SqlConnection(ConfigurationManager.ConnectionStrings("cs").ConnectionString)
36. Dim mycmd As New SqlCommand("se_equipmentimages_insert", myConn)
37. mycmd.CommandType = CommandType.StoredProcedure
38.
39. mycmd.Parameters.AddWithValue("@equipment_id", id)
40. mycmd.Parameters.AddWithValue("@image_file", data)
41.
42. Try
43. myConn.Open()
44. mycmd.ExecuteNonQuery()
45. Catch ex As Exception
46. Finally
47. myConn.Close()
48. End Try
49.
50. Else
51. lblError.Text = "Please only upload .jpg or .gif files"
52. lblError.Visible = True
53. End If
54. Else
55. lblError.Text = "No file selected"
56. lblError.Visible = True
57. End If
to wit...
dbase name: mydBase
table name: dBaseTable
column names :fileOne, fileTwo, fileThree
where in the code above does this go?
also, how does this code work for multiple fileuploads at once?
thanks
james
|
|
|
|
|
What do you mean by dbase info ?
If you mean connection string, it is here.
oedipusrex wrote: Dim myConn As New SqlConnection(ConfigurationManager.ConnectionStrings("cs").ConnectionString)
He added a connectionString section in the web.config with the name "cs"foreach(Minute m in MyLife)
myExperience++;
|
|
|
|
|
Your database information is probably in the web.config file.Me, I'm dishonest. And a dishonest man you can always trust to be dishonest. Honestly. It's the honest ones you want to watch out for...
|
|
|
|
|
|
I used ASP.net with C#, I face always this problem when I redirect my aspx page with some ajax controls. It took too much time. If you have any solution about this so please Help!!!! Me....
Example:
Response.Redirect("~/MemberInfo/UserFrontPage.aspx");
|
|
|
|
|
Is this problem with all page redirection or some specific page ?
|
|
|
|
|
same problem with all pages, even I used simple page with some text, redirects some time slower.
|
|
|
|
|
Hi, you can try server.transfer, it only has one postback, but Response.Redirect has two.
modified 27-May-14 4:51am.
|
|
|
|
|
I think you can redirect page in client browser using js code.
modified 27-May-14 4:50am.
|
|
|
|
|
Can you explaim me how to redirect page using JS but, Page must open in same explorer not in another Popup window.
|
|
|
|
|
since you are using C#, this is how it will work
Response.Redirect(@"~/MemberInfo/UserFrontPage.aspx");
or
Response.Redirect("~//MemberInfo//UserFrontPage.aspx");
and not
Response.Redirect("~/MemberInfo/UserFrontPage.aspx");
Hope it's helpful?Tunsten
|
|
|
|
|
Hi,
I am using a multiview in one of my webpage but when I am switching from one view to another in multiview I can't access any control value of previous view to current view. Why am I geeting this problem?
Thanks & Regards
Rock Star
|
|
|
|
|
At a time only one view gets rendered on page.So you cannot access the controls of one view from another.If you have to access some value from another view ,you can put it in viewstate etc. Cheers!!
Brij
|
|
|
|
|
How can we do paging and sorting in a single gridview?
Known is a drop, unknown is an ocean
|
|
|
|
|
|
Go through the following link
Click hereCheers!!
Brij
|
|
|
|