|
I am new to MVC i have a very basic question. Hope you will bear it.
I have two tables Contact and Addresses. Addresses is the child table of Contact. When i create view for Contact. i also want to get addresses for user as many as user wants. For contact table i bind the textbox and add validation like this
<%= Html.TextBoxFor(model => model.ContactName) %>
<%= Html.ValidationMessageFor(model => model.ContactName) %>
Now my question is that how can i bind address field on create view screen.
Regards Tassadaque
|
|
|
|
|
Hi all,
I have got a problem in my application.I am executing a query which is quite lengthy.Some times i got a problem page time out expire.Can any one help me how to overcome this problem.
i have used
command.Timeout and connectTimeout and pooling in connection string.
But still it is not working.
|
|
|
|
|
I m not sure it will help but,
try to increase execution time of your page
like
<httpRuntime
executionTimeout="3600"
/>
hope this help
|
|
|
|
|
|
I get an javascript expected ')' error on the code below:
function toggle()
{
if (document.getElementById("<%= RadioButtonList_Liability.ClientID %>").value == "Yes")
{
document.getElementById("<%= Label_Liability.ClientID %>").style.visibility = "inherit";
}
else
{
document.getElementById("<= Label_Liability.ClientID %>).style.visibility = "hidden";
}
)
for the life of me, I don't see anything wrong ....
|
|
|
|
|
Never mind, now that I see it in this editor I see the paren is wrong ... sigh ...
|
|
|
|
|
line no 10 in your javascript....
document.getElementById("<= Label_Liability.ClientID %>).style.visibility = "hidden";
% is missing......
!- F - R - I - E - N - D - S -!
|
|
|
|
|
Couple of things that I see is missing/wrong...
1.
document.getElementById("<= Label_Liability.ClientID %>).style.visibility = "hidden";
should be
document.getElementById("<%= Label_Liability.ClientID %>").style.visibility = "hidden";
2. I see one extra ")" at the end of the javascript block... Line 12.
Suggestion -
Always use single quote ['] with javascript.
|
|
|
|
|
Salam
I've problem to add a picture to database sqlserver,what's the simple solution to this and how can i use the table which it has pictures with formview and this is the example that's i mist have,and thanks to ALL.
SALAM.
|
|
|
|
|
|
Hi,
I am working with the HTTP Post method to log the user into my framework. I have done everything required for it, but when I run the page it does not redirect to the Page given in URL. What I am doing wrong?
Thanks
|
|
|
|
|
friend you need to give more information for solving your problem.
|
|
|
|
|
Without seeing your code it is not possible to say where you are wrong. Add the relevant code snippet to your question.
..Go Green..
|
|
|
|
|
Here is my code:
string strResponse;
string strPost;
protected void Page_Load(object sender, EventArgs e)
{
strPost = "txtUserName=abc&txtPassword=123";
UTF8Encoding objUTFEncode = new UTF8Encoding();
byte[] arrRequest = null;
Stream objStreamReq;
StreamReader objStreamRes;
HttpWebRequest objHttpRequest;
HttpWebResponse objHttpResponse;
Uri objUri = new Uri("http://www.mysite.com");
objHttpRequest = HttpWebRequest.Create(objUri) as HttpWebRequest;
objHttpRequest.KeepAlive = false;
objHttpRequest.Method = "POST";
objHttpRequest.ContentType = "application/x-www-form-urlencoded";
arrRequest = objUTFEncode.GetBytes(strPost);
objHttpRequest.ContentLength = arrRequest.Length;
objStreamReq = objHttpRequest.GetRequestStream();
objStreamReq.Write(arrRequest, 0, arrRequest.Length);
objStreamReq.Close();
CookieContainer cookieContainer = new CookieContainer();
objHttpRequest.CookieContainer = cookieContainer;
//Get response
objHttpResponse = objHttpRequest.GetResponse() as HttpWebResponse;
objStreamRes = new StreamReader(objHttpResponse.GetResponseStream(), Encoding.ASCII);
strResponse = objStreamRes.ReadToEnd();
objStreamRes.Close();
}
|
|
|
|
|
Hi, I have a datalist paging enabled in my datalist that shows 10 records per page. but I would like to display a image after every 3rd record. not sure how do i do that. could someone please help? I basically like to inject a hard coded image in the datalist.
|
|
|
|
|
This is Silverlight client-side code.
I would expect it to simultaneously increment the values of both textboxes and therefore take approx. 10 seconds to complete.
Instead, it takes 20 seconds as if the two cycles were running sequentially.
I know there's something wrong with it, but what?
private void button1_Click(object sender, RoutedEventArgs e)<br />
{ <br />
BackgroundWorker bw = new BackgroundWorker(); <br />
bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(Rsz);<br />
bw.RunWorkerAsync();<br />
textBox1.Text = "0";<br />
for (int i = 0; i < 100; i++)<br />
{<br />
System.Threading.Thread.Sleep(100);<br />
textBox1.Text = i.ToString();<br />
}<br />
}<br />
private void Rsz(object sender, RunWorkerCompletedEventArgs e)<br />
{<br />
textBox2.Text = "0";<br />
for (int i = 0; i < 100; i++)<br />
{<br />
System.Threading.Thread.Sleep(100);<br />
textBox2.Text = i.ToString();<br />
} <br />
}
|
|
|
|
|
I have an asp hidden field on my webpage and am trying to access it through javascript. see code below:
function filterclick(){
alert('hello');
alert(document.getElementById('FilterSelected').value);
alert('hello');
<asp:heddenfield id="FilterSelected" runat="server" value="0">
Now, I see the first alert('hello') but none after that?
Thanks,
Steve Holdorf
|
|
|
|
|
Steve Holdorf wrote: <asp:heddenfield id="FilterSelected" runat="server" value="0">
Is this inside a master page or a user control? If so, the id will not be just 'FilterSelected'.
Just do the ViewSource of the page, find the hidden field and see what name has been given while rendering it. Use that in your javascript and you will be fine.
Or else, use:
document.getElementById('<% = FilterSelected.ClientID %>').value in your javascript, it will automatically use the correct name.
|
|
|
|
|
Hi,
I need help saving reports as pdf. Right now, the user has to run the report and save it as pdf manually.
Is there a way to do this dynamically?
Thanks,
Martin
|
|
|
|
|
They could subscribe to the report and have it emailed to them as a pdf.
|
|
|
|
|
Thanks, but I have to be able to run the reports and save them.
Martin
|
|
|
|
|
Subscriptions do have an option to output to a given directory.
Of course Reporting Services may not be the correct tool for the job. What is the end goal? Presumably the end user does something, or clicks something that generates this pdf? If you are merely using reporting services to dump a grid, or Form to PDF there are many other ways of doing it. The Infragistics Grid, for example, has Export to PDF built in, as do others. There is also an open source PDF writer out there called SharpPDF[^]. I believe the learning curve is pretty steep though. If you are in a pure web environment I would have thought Reporting Services pretty much does the job.
|
|
|
|
|
The end goal is to create a nice looking report and save it as pdf. I have to format the report. This is a VB.NET background application without a GUI. At the end of the day, it collects data and saves it as an easy to read pdf.
Thanks,
Martin
|
|
|
|
|
I am developing an app that has several controls at the top and bottom of each page (images, prev/next buttons, and labels that have dynamic content).
I decided to use a master page to display and control the common elements, and the code got a bit tricky but it works and it is solid. I did this to avoid duplicaiton of controls and code on multiple pages. I found out, though, that some people think it is a bad idea to put code in a master page.
What are the best practices for choosing to use a master page?
|
|
|
|
|
There isn't really a best practice that I'm aware of. Just like any project, appropriate techniques should be used in the appropriate place. If the master page needs to set some text or elements, that it is appropriate to set it there.
I know the language. I've read a book. - _Madmatt
|
|
|
|